-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (38 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
58 lines (38 loc) · 1.04 KB
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
49
50
51
52
53
54
55
56
57
58
# syntax=docker/dockerfile:1.7-labs
ARG NODE_IMAGE=node:22-alpine
ARG NGINX_IMAGE=nginx:alpine
FROM ${NODE_IMAGE} AS dependencies
WORKDIR /code
COPY .yarn/ .yarn/
COPY .yarnrc.yml ./
COPY yarn.lock ./
COPY package.json ./
COPY turbo.json ./
RUN corepack enable
RUN yarn set version 4.5.0
FROM dependencies AS packages
COPY --parents config/*/package.json .
COPY --parents packages/*/package.json .
COPY --parents apps/*/package.json .
FROM packages AS installer
RUN yarn install
RUN yarn cache clean --all
FROM installer AS source
ARG APP
COPY config/ config/
COPY packages/types/ packages/types/
COPY packages/utils/ packages/utils/
COPY packages/models/ packages/models/
COPY packages/stores/ packages/stores/
COPY packages/ui/ packages/ui/
COPY apps/${APP} apps/${APP}
FROM source AS builder
ARG API_URL
ENV VITE_API_URL=$API_URL
RUN yarn build
FROM ${NGINX_IMAGE} AS nginx
ARG APP
COPY --from=builder /code/apps/${APP}/dist /usr/share/nginx/html
COPY .nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]