-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (28 loc) · 913 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
FROM node:lts-slim AS api
COPY api /app/api
COPY shared /app/shared
WORKDIR /app/api
RUN yarn install && \
yarn build && \
rm -rf shared && \
yarn install --production
FROM node:lts-alpine AS client
COPY client /app/client
COPY shared /app/shared
WORKDIR /app/client
COPY package.json rootpackage.json
RUN \
yarn install && \
export VITE_APP_VERSION=$(node -pe "require('./rootpackage.json').version") && \
export VITE_APP_NAME=$(node -pe "require('./rootpackage.json').name") && \
VITE_API_URL=/api yarn build && \
rm rootpackage.json
FROM node:lts-slim AS build
RUN yarn global add typeorm
COPY --from=api /app/api/dist/ /app/dist
COPY --from=api /app/api/node_modules/ /app/node_modules
COPY --from=api /app/api/package.json /app/package.json
COPY --from=client /app/client/dist /app/dist/api/src/client
EXPOSE 5000
WORKDIR /app
CMD [ "/bin/sh", "-c", "yarn start:prod" ]