forked from catarse/catarse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.Dockerfile
42 lines (39 loc) · 1.54 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
37
38
39
40
41
42
FROM ruby:2.7.1-alpine
#FROM alpine:3.7
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
ENV RUBY_PACKAGES ruby ruby-io-console ruby-bundler ruby-irb ruby-bigdecimal ruby-json nodejs nodejs-npm zlib-dev yaml-dev readline-dev ruby-dev ncurses
#
## 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
#
RUN gem install bundler:1.17.3
#
COPY Gemfile /usr/app/
COPY Gemfile.lock /usr/app/
#
RUN bundle install
COPY . /usr/app
RUN npm install
#
#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