-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (29 loc) · 830 Bytes
/
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
FROM parthmodi/rails_base:latest
RUN apt-get update && \
apt-get install -y libpq-dev imagemagick && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
ENV RAILS_LOG_TO_STDOUT true
# Workdir
RUN mkdir -p /home/app
WORKDIR /home/app
# Install gems
ADD Gemfile* /home/app/
ADD docker /home/app/docker/
RUN bundle install
# Add the Rails app
ADD . /home/app
# # Create user and group
RUN groupadd --gid 9999 app && \
useradd --uid 9999 --gid app app && \
chown -R app:app /home/app
# Save timestamp of image building
RUN date -u > BUILD_TIME
ENV RAILS_LOG_TO_STDOUT true
ENV RAILS_SERVE_STATIC_FILES false
# RUN mkdir -p /etc/nginx/conf.d/
# COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
RUN chmod +x docker/entrypoint.sh
ENV APPNAME docker_demo
EXPOSE 3000
CMD [ "docker/entrypoint.sh" ]