-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 831 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 831 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
FROM ruby:4.0.3-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
build-essential \
libyaml-dev && \
rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 frankfurter
RUN mkdir /app && chown frankfurter:frankfurter /app
WORKDIR /app
COPY --chown=frankfurter:frankfurter Gemfile Gemfile.lock mise.toml ./
RUN gem install bundler && \
bundle config set --local deployment 'true' && \
bundle config set --local without 'development test' && \
bundle install
COPY --chown=frankfurter:frankfurter . .
ENV APP_ENV=production
ENV PORT=8080
USER frankfurter
HEALTHCHECK --interval=2s --timeout=4s --start-period=3s --retries=15 \
CMD curl -f "http://localhost:${PORT:-8080}" || exit 1
CMD ["sh", "-c", "bundle exec rake db:setup && exec bundle exec foreman start"]