forked from zhpd/chatgpt-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (37 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# build front-end
FROM node:lts-alpine AS frontend
WORKDIR /app
COPY ./package.json /app
# COPY ./package-lock.json /app
RUN npm install
COPY . /app
RUN npm run build
# build backend
FROM node:lts-alpine AS backend
WORKDIR /app
COPY ./service/package.json /app
COPY ./service/package-lock.json /app
RUN npm install
COPY ./service /app
RUN npm run build
# service
FROM node:lts-alpine
RUN apk add --no-cache bash
WORKDIR /app
RUN mkdir -p /app/log
# copy front-end
COPY --from=frontend /app/.next/standalone /app/web
COPY --from=frontend /app/.next/static /app/web/.next/static
COPY ./public /app/web/public
WORKDIR /app/service
# copy backend
COPY ./service/package.json /app/service
COPY ./service/package-lock.json /app/service
RUN npm install --production && rm -rf /usr/local/share/.cache /tmp/*
COPY --from=backend /app/dist /app/service/dist
# start.sh
COPY ./docker-start.sh /app
EXPOSE 3000
EXPOSE 3002
WORKDIR /app
CMD [ "/bin/sh", "./docker-start.sh" ]