diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 047470a..35de1e9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,4 +32,4 @@ jobs: with: context: . push: true - tags: wongsaang/chatgpt-ui:latest,wongsaang/chatgpt-ui:${{ github.ref_name }} + tags: wongsaang/chatgpt-ui-client:latest,wongsaang/chatgpt-ui-client:${{ github.ref_name }} diff --git a/Dockerfile b/Dockerfile index 2e4a925..73e42d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,18 +8,15 @@ RUN yarn install COPY . . -RUN yarn build +RUN yarn generate -FROM node:18-alpine3.16 - -ENV NITRO_HOST=0.0.0.0 -ENV NITRO_PORT=80 +FROM nginx:alpine WORKDIR /app -COPY --from=builder /app/.output . +COPY --from=builder /app/.output/public . -EXPOSE 80 +COPY nginx.conf /etc/nginx/templates/default.conf.template -ENTRYPOINT ["node", "server/index.mjs"] \ No newline at end of file +EXPOSE 80 \ No newline at end of file diff --git a/app2.vue b/app2.vue deleted file mode 100644 index 93e1cea..0000000 --- a/app2.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 86480ad..a4a1fb3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,31 @@ version: '3' services: - app: + client: build: context: . dockerfile: ./Dockerfile + environment: + - SERVER_DOMAIN=http://backend:8000 + depends_on: + - backend + volumes: + - backend_static:/app/static ports: - - '${APP_PORT:-80}:80' \ No newline at end of file + - '80:80' + networks: + - chatgpt_ui_network + backend: + image: 'wongsaang/chatgpt-ui-server:latest' + volumes: + - backend_static:/app/static + ports: + - '8000:8000' + networks: + - chatgpt_ui_network + +networks: + chatgpt_ui_network: + driver: bridge + +volumes: + backend_static: \ No newline at end of file diff --git a/layouts/default.vue b/layouts/default.vue index ebcfa79..2a87f8d 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -63,7 +63,6 @@ onNuxtReady(async () => {
- diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..9c37166 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /app; + index index.html; + } + + location /api/ + { + proxy_pass ${SERVER_DOMAIN}; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /admin/ { + proxy_pass ${SERVER_DOMAIN}; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +}