-
Notifications
You must be signed in to change notification settings - Fork 133
/
Dockerfile
61 lines (42 loc) · 1.31 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# # build front-end
# FROM node:lts-alpine AS frontend
# WORKDIR /app
# COPY . /app
# COPY ./package.json /app
# COPY ./package-lock.json /app
# RUN npm install --registry=https://registry.npmmirror.com
# RUN npm run build
# RUN rm -rf ./node_modules
# # build backend
# FROM node:lts-alpine AS backend
# WORKDIR /app
# COPY ./service /app
# COPY ./service/package.json /app
# COPY ./service/package-lock.json /app
# RUN npm install --registry=https://registry.npmmirror.com
# RUN npm run build
# RUN rm -rf ./node_modules
# service
FROM node:lts-alpine
RUN apk add --no-cache bash
RUN mkdir -p /app/log
WORKDIR /app
# # copy front-end -- 从docker构建中复制,运行太慢
# COPY --from=frontend /app/.next/standalone /app/web
# COPY --from=frontend /app/.next/static /app/web/.next/static
# COPY ./public /app/web/public
# copy .next/front -- 从源码构建结果中复制
COPY .next/standalone /app/web
COPY .next/static /app/web/.next/static
COPY ./public /app/web/public
WORKDIR /app/service
# # copy backend -- 从docker构建中复制,运行太慢
# COPY --from=backend /app/dist /app/service/dist
# copy service/dist/backend -- 从源码构建结果中复制
COPY service/dist /app/service/dist
# start.sh
COPY ./docker-start.sh /app
EXPOSE 3000
EXPOSE 3002
WORKDIR /app
CMD [ "/bin/sh", "./docker-start.sh" ]