File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11version : ' 3.6'
22
33services :
4- web :
5- build : .
4+ app :
5+ build :
6+ context : .
7+ dockerfile : Dockerfile
68 image : 81318131/fastapi_gpt
79 container_name : fastapi_gpt
8- command : fastapi run app/main.py --port 80
10+ command : fastapi run app/main.py --port 8080
911 volumes :
1012 - ' ./app:/code/app'
1113 environment :
1214 OPENAI_API_KEY : ${KEY:-}
1315 TEST : ${TEST:-}
1416 ports :
15- - " 80:80"
17+ - " 8080:8080"
18+ networks :
19+ - app_network
20+
21+ web :
22+ build :
23+ context : ./web
24+ dockerfile : Dockerfile
25+ args :
26+ VITE_API_CLIENT_BASE_URL : " http://localhost:8080"
27+ image : 81318131/web_gpt
28+ container_name : web_gpt
29+ ports :
30+ - " 80:4173"
31+ depends_on :
32+ - app
33+ networks :
34+ - app_network
35+
36+
37+ networks :
38+ app_network :
39+ driver : bridge
Original file line number Diff line number Diff line change 1+ FROM node:18-alpine AS builder
2+ ARG VITE_API_CLIENT_BASE_URL
3+ ENV VITE_API_CLIENT_BASE_URL=${VITE_API_CLIENT_BASE_URL}
4+ WORKDIR /app
5+ RUN npm install -g pnpm
6+ COPY package.json pnpm-lock.yaml ./
7+ RUN pnpm install
8+ COPY . .
9+ RUN pnpm run build
10+
11+ FROM nginx:stable-alpine AS production
12+ WORKDIR /usr/share/nginx/html
13+ RUN rm -rf ./*
14+ COPY --from=builder /app/dist ./
15+ COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
16+ EXPOSE 4173
17+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change 1+ server {
2+ listen 4173 ;
3+
4+ location / {
5+ root /usr/share/nginx/html;
6+ index index .html index .htm;
7+ try_files $uri $uri / /index .html;
8+ }
9+
10+ location /notFound {
11+ return 404 ;
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments