-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.prod
More file actions
39 lines (25 loc) · 844 Bytes
/
Dockerfile.prod
File metadata and controls
39 lines (25 loc) · 844 Bytes
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
ARG RUBY_VERSION=3.1
FROM ruby:${RUBY_VERSION}
ARG BUNDLER_VERSION=2.3
ARG UNAME=app
ARG UID=1000
ARG GID=1000
LABEL maintainer="mrio@umich.edu"
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
apt-transport-https
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
nodejs \
vim-tiny
RUN gem install bundler:${BUNDLER_VERSION}
RUN groupadd -g ${GID} -o ${UNAME}
RUN useradd -m -d /app -u ${UID} -g ${GID} -o -s /bin/bash ${UNAME}
RUN mkdir -p /gems && chown ${UID}:${GID} /gems
COPY --chown=${UID}:${GID} Gemfile* /app/
USER $UNAME
ENV BUNDLE_PATH /gems
ENV BUNDLE_WITHOUT development:test
WORKDIR /app
RUN bundle _${BUNDLER_VERSION}_ install
COPY --chown=${UID}:${GID} . /app
CMD ["bin/rails", "s", "-b", "0.0.0.0"]