File tree Expand file tree Collapse file tree 6 files changed +33
-20
lines changed Expand file tree Collapse file tree 6 files changed +33
-20
lines changed Original file line number Diff line number Diff line change 1- FROM node:18
2-
1+ FROM node:18 AS builder
32WORKDIR /app
43COPY package.json .
5- RUN yarn
6-
4+ COPY yarn.lock .
5+ RUN yarn install --frozen-lockfile
76COPY . .
8- # this will modify node_modules/@prisma/client
9- RUN yarn run prisma generate
7+ RUN yarn build
108
11- CMD ["yarn" , "dev" ]
9+ FROM node:18 AS server
10+ WORKDIR /app
11+ COPY package.json .
12+ COPY yarn.lock .
13+ RUN yarn install --production
14+ COPY prisma .
15+ RUN yarn run prisma generate
16+ COPY --from=builder ./app/build ./build
17+ EXPOSE 4000
18+ CMD ["yarn" , "start" ]
Original file line number Diff line number Diff line change 55 "license" : " MIT" ,
66 "scripts" : {
77 "build" : " tsc" ,
8+ "start" : " node build/start-server.js" ,
89 "dev" : " ts-node-dev src/start-server.ts" ,
910 "test" : " jest --config jest.config.js"
1011 },
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
3- "module" : " esnext " ,
3+ "module" : " commonjs " ,
44 "outDir" : " ./build" ,
55 "target" : " esnext" ,
66 "allowJs" : true ,
Original file line number Diff line number Diff line change 33Build the docker images:
44
55```
6- docker build -t lihebi/codepod-ui:v0.1.0 ./ui
7- docker build -t lihebi/codepod-api:v0.1.0 ./api
6+ docker build -t lihebi/codepod-ui:v0.4.2 ./ui
7+ docker build -t lihebi/codepod-api:v0.4.2 ./api
88docker build -t lihebi/codepod_kernel_python:v0.1.0 ./api/kernels/python
99```
1010
1111Push to registry:
1212
1313```
14- docker push lihebi/codepod-ui:v0.1.0
15- docker push lihebi/codepod-api:v0.1.0
14+ docker push lihebi/codepod-ui:v0.4.2
15+ docker push lihebi/codepod-api:v0.4.2
1616docker push lihebi/codepod_kernel_python:v0.1.0
1717```
1818
Original file line number Diff line number Diff line change 1818 spec :
1919 containers :
2020 - name : codepod-ui
21- image : lihebi/codepod-ui:v0.2.0
21+ image : lihebi/codepod-ui:v0.4.2
2222 ports :
23- - containerPort : 3000
23+ - containerPort : 80
2424
2525---
2626apiVersion : v1
3333 ports :
3434 - protocol : TCP
3535 port : 80
36- targetPort : 3000
36+ targetPort : 80
3737
3838# API
3939---
5555 spec :
5656 containers :
5757 - name : codepod-api
58- image : lihebi/codepod-api:v0.2.0
58+ image : lihebi/codepod-api:v0.4.2
5959 ports :
6060 - containerPort : 4000
6161 env :
Original file line number Diff line number Diff line change 1- FROM node:18
1+ FROM node:18 AS builder
22
33WORKDIR /app
4- COPY ./package.json package.json
5- RUN yarn
4+ COPY package.json .
5+ COPY yarn.lock .
6+ RUN yarn install --frozen-lockfile
67
8+ # FIXME would this copy node_modules?
79COPY . .
810
9- CMD ["yarn" , "start" ]
11+ RUN yarn build
12+
13+ FROM nginx:1.19-alpine AS server
14+ COPY --from=builder ./app/build /usr/share/nginx/html
You can’t perform that action at this time.
0 commit comments