forked from catarse/catarse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.Dockerfile
36 lines (28 loc) · 1.38 KB
/
dev.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM alpine
MAINTAINER Catarse <[email protected]>
ENV BUILD_PACKAGES postgresql-dev libxml2-dev libxslt-dev imagemagick imagemagick-dev openssl libpq libffi-dev bash curl-dev libstdc++ tzdata bash ca-certificates build-base ruby-dev libc-dev linux-headers postgresql-client postgresql git nodejs
ENV RUBY_PACKAGES ruby ruby-io-console ruby-bundler ruby-irb ruby-bigdecimal ruby-json
# Update and install all of the required packages.
# At the end, remove the apk cache
RUN apk update && \
apk upgrade && \
apk --update add --virtual build_deps $BUILD_PACKAGES && \
apk --update add $RUBY_PACKAGES
RUN mkdir /usr/app
WORKDIR /usr/app
COPY Gemfile /usr/app/
COPY Gemfile.lock /usr/app/
RUN bundle install
COPY . /usr/app
RUN cp /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime && echo "America/Sao_Paulo" > /etc/timezone
# ==================================================================================================
# 7: Copy the rest of the application code, install nodejs as a build dependency, then compile the
# app assets, and finally change the owner of the code to 'nobody':
RUN set -ex \
&& mkdir -p /usr/app/tmp/cache \
&& mkdir -p /usr/app/tmp/pids \
&& mkdir -p /usr/app/tmp/sockets
# && chown -R nobody /usr/app
# ==================================================================================================
# 8: Set the container user to 'nobody':
#USER nobody