blockstream-satellite-api/Dockerfile

33 lines
972 B
Text
Raw Normal View History

2019-01-16 10:22:44 -08:00
FROM alpine:latest
ENV RUBY_PACKAGES ruby ruby-io-console ruby-irb ruby-rake ruby-bundler ruby-bigdecimal ruby-json
ENV RUBY_DEPS libstdc++ tzdata bash ca-certificates openssl sqlite sqlite-dev
RUN addgroup -g 1000 ionosphere \
&& adduser -u 1000 -D -G ionosphere ionosphere
RUN apk update && \
apk upgrade && \
apk --update add $RUBY_PACKAGES $RUBY_DEPS && \
echo 'gem: --no-document' > /etc/gemrc
RUN mkdir /app && \
mkdir -p /data/ionosphere
COPY Gemfile /app
COPY Gemfile.lock /app
WORKDIR /app
# install packages needed for building compiled gems; install gems; then delete build dependencies to keep Docker image small
2019-02-07 20:27:36 -08:00
ENV BUILD_PACKAGES sudo build-base ruby-dev libc-dev linux-headers openssl-dev git
2019-01-16 10:22:44 -08:00
RUN apk --update add --virtual build_deps $BUILD_PACKAGES && \
bundle install && \
apk del build_deps && \
rm -rf /var/cache/apk/*
COPY . /app
RUN chown -R ionosphere:ionosphere /app
USER ionosphere
CMD ./docker_entrypoint.sh