-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (29 loc) · 992 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
36
37
38
39
40
41
42
43
## ---------------------------------------------------------------------
## ---------------------------------------------------------------------
## This Dockerfile is to setup app in only ONE Container
## ---------------------------------------------------------------------
## ---------------------------------------------------------------------
# -------------------
# BUILD - Frontend
# -------------------
FROM node:20.11.1-bullseye-slim AS build-frontend
WORKDIR /app/frontend
COPY frontend/package.json .
COPY frontend/yarn.lock .
RUN yarn install
COPY frontend/ .
RUN yarn build-only
# -----------------------------
# BUILD AND RUNNER - Backend
# -----------------------------
FROM node:20.11.1-bullseye-slim AS backend
WORKDIR /app/backend
COPY backend/package.json .
COPY backend/yarn.lock .
RUN yarn install
COPY backend/ .
RUN yarn prisma:generate
RUN yarn build
COPY --from=build-frontend /app/frontend/dist client/
EXPOSE 8080
CMD ["yarn", "start:migrate:prod"]