-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.admin
49 lines (37 loc) · 1.12 KB
/
Dockerfile.admin
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
FROM node:16-alpine AS builder
# Add a work directory
WORKDIR /app
# install deps
COPY package.json .
COPY yarn.lock .
COPY ./apps/admin/package.json apps/admin/
COPY ./packages/api-service/package.json packages/api-service/
COPY ./packages/auth/package.json packages/auth/
COPY ./packages/components/package.json packages/components/
COPY ./packages/query-api-service/package.json packages/query-api-service/
COPY ./packages/utils/package.json packages/utils/
RUN yarn install --pure-lockfile --non-interactive
COPY . .
WORKDIR /app/packages/api-service
RUN yarn build
WORKDIR /app/packages/query-api-service
RUN yarn build
WORKDIR /app/packages/auth
RUN yarn build
WORKDIR /app/packages/utils
RUN yarn build
WORKDIR /app/packages/components
RUN yarn build
WORKDIR /app/apps/admin
RUN yarn build
# Bundle static assets with nginx
FROM nginx:1.21.0-alpine as production
ENV NODE_ENV production
# Copy built assets from builder
COPY --from=builder /app/apps/admin/build /usr/share/nginx/html
# Add your nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 3007
# Start nginx
CMD ["nginx", "-g", "daemon off;"]