-
Notifications
You must be signed in to change notification settings - Fork 3
/
_api.tts.Dockerfile
28 lines (27 loc) · 1.2 KB
/
_api.tts.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
# builder
FROM node:20-slim AS builder
ENV NODE_ENV=development
RUN mkdir -p /source
WORKDIR /source
COPY package*.json ./
COPY . ./
RUN npm pkg delete scripts.prepare
RUN npm install --loglevel=error --force -w @packages/common -w @projects/api.tts
ENV NODE_ENV=production
RUN ["npm", "run", "build", "-w", "@packages/common"]
RUN ["npm", "run", "build", "-w", "@projects/api.tts"]
# server
FROM node:20-slim AS server
RUN mkdir -p /source
WORKDIR /source
ENV NODE_ENV=production
COPY --from=builder /source/package.json /source/package.json
COPY --from=builder /source/packages/common/package.json /source/packages/common/package.json
COPY --from=builder /source/packages/common/build /source/packages/common/build
COPY --from=builder /source/projects/api/tts/package.json /source/projects/api/tts/package.json
COPY --from=builder /source/projects/api/tts/.env.production /source/projects/api/tts/.env.production
COPY --from=builder /source/projects/api/tts/build /source/projects/api/tts/build
COPY --from=builder /source/projects/api/tts/storage /source/projects/api/tts/storage
COPY --from=builder /source/node_modules /source/node_modules
EXPOSE 3001
ENTRYPOINT ["npm", "run", "start:prod", "-w", "@projects/api.tts"]