-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
74 lines (59 loc) · 1.93 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Dockerfile
#
# The mix of packages to add are based on the needs of various gems:
# @see https://github.com/exAspArk/docker-alpine-ruby/blob/master/Dockerfile
FROM ruby:2.5.1-alpine
RUN apk add --no-cache \
bash \
build-base \
curl-dev \
g++ \
gcc \
git \
libc-dev \
libcurl \
libffi-dev \
libxml2 \
libxslt-dev \
mariadb-dev \
nodejs \
sqlite-dev \
tzdata \
yarn
# =============================================================================
# :section: System setup
# =============================================================================
ENV USER=docker \
GROUP=sse \
LANG='en_US.UTF-8' \
LC_ALL='en_US.UTF-8' \
LANGUAGE='en_US:en' \
TZ='America/New_York'
# Create the run user and group
RUN addgroup -g 18570 $GROUP && adduser -u 1984 $USER -G $GROUP -D
# Set the timezone
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
# =============================================================================
# :section: Platform setup
# =============================================================================
ENV APP_HOME=/virgo4 \
RAILS_ENV=production
# define work directory
WORKDIR $APP_HOME
# Copy the Gemfile and Gemfile.lock into the image.
ADD Gemfile Gemfile.lock ./
RUN bundle install --retry=2 --jobs=4 --without=["development" "test"] --no-cache
# Create work directory and copy the application to it.
ADD . $APP_HOME
# Generate the assets.
RUN SECRET_KEY_BASE=x rake assets:precompile
# Update permissions on the application and user home directory.
RUN chown -R $USER:$GROUP $APP_HOME /home/$USER
# =============================================================================
# :section: Launch the application
# =============================================================================
# Set the user for the process.
USER $USER:$GROUP
# Define port and startup script.
EXPOSE 3000
CMD bin/Docker_run.sh