forked from cogentapps/chat-with-gpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (28 loc) · 919 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
FROM node:19-alpine AS build
RUN addgroup -S app && adduser -S app -G app
RUN mkdir /app && chown app:app /app
RUN apk add --update --no-cache git
USER app
WORKDIR /app
COPY ./app/package.json ./
COPY ./app/tsconfig.json ./
RUN npm install
COPY ./app/craco.config.js ./craco.config.js
COPY ./app/public ./public
COPY ./app/src ./src
ENV NODE_ENV=production
ENV REACT_APP_AUTH_PROVIDER=local
RUN npm run build
FROM node:19-alpine AS server
RUN addgroup -S app && adduser -S app -G app
WORKDIR /app
COPY ./server/package.json ./
COPY ./server/tsconfig.json ./
RUN apk add --update --no-cache python3 py3-pip make g++ git
RUN npm install
COPY ./server/src ./src
RUN CI=true sh -c "cd /app && mkdir data && npm run start && rm -rf data"
COPY --from=build /app/build /app/public
LABEL org.opencontainers.image.source="https://github.com/cogentapps/chat-with-gpt"
ENV PORT 3000
CMD ["npm", "run", "start"]