-
-
Notifications
You must be signed in to change notification settings - Fork 138
/
Dockerfile.server.production
47 lines (31 loc) · 1.26 KB
/
Dockerfile.server.production
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
44
45
46
47
FROM node:20-alpine AS builder
WORKDIR /app
ENV MONGO_ENDPOINT=mongodb://mongo:27017/your_spotify
RUN apk add python3 gcc g++ make cmake
COPY yarn.lock yarn.lock
COPY package.json package.json
COPY apps/dev/package.json apps/dev/package.json
COPY apps/dev/tsconfig.json apps/dev/tsconfig.json
COPY apps/server/package.json apps/server/package.json
COPY apps/server/tsconfig.json apps/server/tsconfig.json
RUN yarn --frozen-lockfile
COPY apps/server/src apps/server/src
COPY apps/server/scripts apps/server/scripts
WORKDIR /app/apps/server
RUN yarn build
ARG NODE_ENV
ENV NODE_ENV ${NODE_ENV:-production}
RUN rm -r node_modules
RUN yarn --production --frozen-lockfile
FROM node:20-alpine
ARG NODE_ENV
ENV NODE_ENV ${NODE_ENV:-production}
WORKDIR /app
RUN apk add python3 gcc g++ make cmake
COPY --from=builder /app/node_modules node_modules
COPY --from=builder /app/package.json package.json
COPY --from=builder /app/apps/server/package.json apps/server/package.json
COPY --from=builder /app/apps/server/scripts/ apps/server/scripts/
COPY --from=builder /app/apps/server/package.json apps/server/package.json
COPY --from=builder /app/apps/server/lib/ apps/server/lib/
ENTRYPOINT [ "sh", "/app/apps/server/scripts/run/run.sh" ]