-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (30 loc) · 1.02 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
FROM node:18-bullseye-slim
COPY . /app/
WORKDIR /app/
# Update apt packages
RUN runDeps="openssl ca-certificates patch gosu git make tmux locales-all" \
&& apt-get update \
&& apt-get install -y --no-install-recommends $runDeps \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g mrs-developer \
&& cp jsconfig.json.prod jsconfig.json \
&& mkdir -p /app/src/addons \
&& rm -rf /app/src/addons/* \
&& find /app/ -not -user node -exec chown node {} \+ \
&& corepack enable
USER node
ARG MAX_OLD_SPACE_SIZE=16384
ARG RAZZLE_PREFIX_PATH=/freshwater
ENV RAZZLE_PREFIX_PATH=$RAZZLE_PREFIX_PATH
ENV NODE_OPTIONS=--max_old_space_size=$MAX_OLD_SPACE_SIZE
RUN yarn \
&& RAZZLE_PREFIX_PATH=$RAZZLE_PREFIX_PATH yarn build \
&& rm -rf /home/node/.cache \
&& rm -rf /home/node/.yarn \
&& rm -rf /home/node/.npm \
&& rm -rf /app/.yarn/cache
USER root
EXPOSE 3000 3001
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["sh", "-c", "RAZZLE_PREFIX_PATH=$RAZZLE_PREFIX_PATH yarn start:prod"]