-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (28 loc) · 680 Bytes
/
Dockerfile
File metadata and controls
48 lines (28 loc) · 680 Bytes
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
48
FROM node:24-alpine AS base
##################
FROM base AS build
WORKDIR /app/api
COPY ./api/package*.json ./
RUN npm ci
COPY ./api ./
RUN npm run build
WORKDIR /app/client
COPY ./client/package*.json ./
RUN npm ci
COPY client ./
RUN npm run build:prod
##################
FROM base AS final
ENV BUDDYDUEL_URL=https://buddyduel.fly.dev
ENV CLIENT_DIST_PATH=/app/client/dist/buddyduel/browser
ENV DATABASE_NAME=prod
ENV NODE_ENV=production
ENV PORT=8080
WORKDIR /app/api
COPY ./api/package*.json ./
RUN npm ci
COPY --from=build /app/api/dist /app/api
WORKDIR /app/client
COPY --from=build /app/client/dist ./dist
EXPOSE 8080
CMD ["node", "/app/api/server.js"]