-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (29 loc) · 1.08 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
FROM node:lts-slim as builder
RUN mkdir -p /app
# Add user so we don't need --no-sandbox.
RUN groupadd -r appuser && useradd -r -g appuser -G audio,video appuser \
&& mkdir -p /home/appuser/Downloads \
&& chown -R appuser:appuser /home/appuser \
&& chown -R appuser:appuser /app
# Run everything after as non-privileged user.
USER appuser
WORKDIR /app
COPY --chown=appuser:appuser . /app
RUN yarn
RUN yarn run build
FROM node:lts-slim
RUN mkdir -p /app
# Add user so we don't need --no-sandbox.
RUN groupadd -r appuser && useradd -r -g appuser -G audio,video appuser \
&& mkdir -p /home/appuser/Downloads \
&& chown -R appuser:appuser /home/appuser \
&& chown -R appuser:appuser /app
# Run everything after as non-privileged user.
USER appuser
WORKDIR /app
COPY --chown=appuser:appuser --from=builder /app/dist /app/dist
COPY --chown=appuser:appuser --from=builder /app/package.json /app
COPY --chown=appuser:appuser --from=builder /app/yarn.lock /app
COPY --chown=appuser:appuser --from=builder /app/queries /app/queries
RUN yarn --prod
ENTRYPOINT ["yarn", "start"]