-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
39 lines (31 loc) · 1.25 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
FROM leikir/ruby-bundler-node-yarn-and-extras:ruby-2.6.6-node-14.16.1-slim
MAINTAINER Yann Hourdel "[email protected]"
ENV INSTALL_PATH /rails
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
# Copy the package.json as well as the yarn.lock and install
# the node modules. This is a separate step so the dependencies
# will be cached unless changes to one of those two files
# are made.
COPY package.json yarn.lock ./
RUN yarn install
# Temporary trick to fasten rebuilds when changing dependencies
COPY docker/rails/Gemfile docker/rails/Gemfile.lock ./
RUN bundle install
# Now copy the real Gemfile as well as the Gemfile.lock and install
# the RubyGems. This is a separate step so the dependencies
# will be cached unless changes to one of those two files
# are made.
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Expose port 3000 to the Docker host, so we can access it
# from the outside.
EXPOSE 3000
# An entrypoint to run migrations and so on
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# The main command to run when the container starts. Also
# tell the Rails dev server to bind to all interfaces by
# default.
CMD ["bundle exec rails server -p 3000 -b 0.0.0.0"]