-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Dockerfile
43 lines (30 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 node:16.18.0-alpine3.16 AS builder
LABEL org.opencontainers.image.source="https://github.com/jef/streetmerchant"
LABEL org.opencontainers.image.description="The world's easiest, most powerful stock checker"
LABEL org.opencontainers.image.licenses="MIT"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
WORKDIR /build
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY tsconfig.json tsconfig.json
RUN npm ci
COPY src/ src/
COPY test/ test/
RUN npm run compile
RUN npm prune --production
FROM node:16.18.0-alpine3.16
RUN apk add --no-cache chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \
DOCKER=true
RUN addgroup -S appuser && adduser -S -g appuser appuser \
&& mkdir -p /home/appuser/Downloads /app \
&& chown -R appuser:appuser /home/appuser \
&& chown -R appuser:appuser /app
USER appuser
WORKDIR /app
COPY --from=builder /build/node_modules/ node_modules/
COPY --from=builder /build/build/ build/
COPY web/ web/
COPY package.json package.json
ENTRYPOINT ["npm", "run"]
CMD ["start:production"]