forked from open-source-labs/ReacType
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-old
79 lines (47 loc) · 1.65 KB
/
Dockerfile-old
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
67
68
69
70
71
72
73
74
75
76
77
78
79
# Stage 1: Build
FROM node:21.2.0-alpine AS build
# python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
RUN apk add --no-cache --virtual .gyp \
python3 \
make \
g++
RUN npm install -g [email protected]
WORKDIR /app
COPY package*.json ./
# also make the below copies for the runtime stage to use.
COPY ./config.js ./config.js
COPY ./server ./server
RUN npm install --production --no-install-recommends --fetch-retry-maxtimeout 500000
# install vite virst
COPY ./index.html ./index.html
#COPY ./app/src/public/styles/style.css ./app/src/public/styles/style.css
COPY ./app/src ./app/src
COPY ./vite.config.ts ./vite.config.ts
COPY ./resources ./resources
COPY ./src ./src
#also copy this one file lol.
ENV NODE_ENV='production'
# i am hoping the above will make it so that the frontend files will know that it is production.
RUN npm run prod-build
#COPY ./build ./build
# they will need the above.
# Stage 2: Runtime
FROM node:21.2.0-alpine AS runtime
WORKDIR /app
COPY --from=build /app/package*.json ./
RUN npm install --production --no-install-recommends --fetch-retry-maxtimeout 500000
# RUN npm run dev-frontend # no, dont just run the app while building
# make a build file?
# --only=prod
# COPY --from=build /app/.env .env
COPY --from=build /app/config.js ./config.js
COPY --from=build /app/server ./server
COPY --from=build /app/build /app/build
COPY .env .env
#just make the env file go into the docker image?
EXPOSE 5656
ENV IS_DOCKER=true
ENV VIDEOSDK='vidsdk'
ENV PORT=5656
# no longer put the envs here
CMD [ "npm", "start" ]