forked from afimb/chouette2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
42 lines (25 loc) · 1.09 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
FROM ruby:3.2.7-slim-bullseye AS base
RUN apt-get update && apt-get -y upgrade && apt-get install -y nodejs libgeos-dev proj-bin libproj-dev sendmail dumb-init shared-mime-info sqlite3 postgresql-client wget
RUN gem update --system 3.4.19
RUN gem install bundler -v 2.4.19
# Line below is to try to solve nokogiri build failure
RUN bundle config build.nokogiri --use-system-libraries
FROM base AS builder
RUN apt-get update && apt-get install -y build-essential libpq-dev libsqlite3-dev git unzip make less patch vim
COPY . /code
WORKDIR /code
RUN git log -n 1 --pretty=format:"%H" > /version
RUN bundle install
FROM base
COPY . /code
WORKDIR /code
RUN addgroup appuser && adduser --disabled-password appuser --ingroup appuser --gecos ""
RUN mkdir -p /code/tmp && chown appuser:appuser /code/tmp
RUN mkdir -p /code/log && chown appuser:appuser /code/log
COPY --from=builder /version /version
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
USER appuser
EXPOSE 3000
ENV RAILS_ENV=production
ENV IEV_DISABLE_CACHE=true
CMD [ "dumb-init", "bundle", "exec", "rails", "server", "-b", "0.0.0.0"]