forked from marudor/bahn.expert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (29 loc) · 894 Bytes
/
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
FROM node:16-alpine as base
WORKDIR /app
ENV CYPRESS_INSTALL_BINARY=0
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/ ./.yarn/
COPY packages/ ./packages/
COPY scripts/ ./scripts/
FROM base as fulldeps
RUN yarn --immutable --immutable-cache
FROM fulldeps as build
COPY webpack.config.js babel.config.js ./
COPY .git ./.git
ENV NODE_ENV=production
RUN yarn all:build
RUN yarn dlx modclean -r -f -a '*.ts|*.tsx' -I 'example*'
RUN node scripts/checkAssetFiles.js
FROM base as cleanedDeps
RUN yarn workspaces focus --production
RUN yarn dlx modclean -r -f -a '*.ts|*.tsx' -I 'example*'
FROM node:16-alpine
ENV NODE_ENV=production
ENV TZ=Europe/Berlin
WORKDIR /app
COPY public/ ./dist/client/
COPY --from=cleanedDeps /app/node_modules/ ./node_modules/
COPY --from=build /app/dist/ ./dist/
COPY --from=build /app/packages/ ./packages/
USER node
CMD [ "node", "packages/server/index.js" ]