/
Dockerfile
44 lines (34 loc) · 1.04 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
43
FROM ruby:3.2.4-slim as base
ENV MALLOC_ARENA_MAX=2
ENV RAILS_LOG_TO_STDOUT=1
ENV RAILS_SERVE_STATIC_FILES=1
ENV RAILS_ENV=production
ENV BUNDLE_WITHOUT=development
ENV NODE_MAJOR=20
WORKDIR /loomio
RUN apt-get update
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update -qq && \
apt-get install -y \
build-essential \
git \
libvips \
ffmpeg \
poppler-utils \
sudo \
nodejs \
imagemagick \
libpq-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists /usr/share/doc /usr/share/man
COPY . .
RUN bundle install && bundle exec bootsnap precompile --gemfile app/ lib/
WORKDIR /loomio/vue
RUN npm install
RUN npm run build
WORKDIR /loomio
EXPOSE 3000
CMD /loomio/docker_start.sh