ci: update docker compose config

This commit is contained in:
thehrz 2024-08-17 10:07:15 +08:00
parent 1aae9a9eca
commit e5428868c7
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855
5 changed files with 53 additions and 9 deletions

View File

@ -1,4 +1,4 @@
version: "3.8"
version: "3.9"
networks:
traefik:
@ -12,6 +12,19 @@ services:
build: ./web
container_name: ipv6-test-frontend
restart: always
networks:
- ipv6-test
backend:
build: .
container_name: ipv6-test-backend
restart: always
networks:
- traefik
- ipv6-test
nginx:
build: ./nginx
container_name: ipv6-test-nginx
restart: always
labels:
- traefik.enable=true
- traefik.http.routers.ipv6-test.rule=Host(`ipv6-test.thehrz.net`)
@ -21,10 +34,3 @@ services:
networks:
- traefik
- ipv6-test
backend:
build: .
container_name: ipv6-test-backend
restart: always
networks:
- traefik
- ipv6-test

3
nginx/Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginx:stable-alpine
WORKDIR /nginx
COPY ./conf.d /etc/nginx/conf.d

View File

@ -0,0 +1,6 @@
server {
listen 80;
listen [::]:80;
return 444;
}

29
nginx/conf.d/www.conf Normal file
View File

@ -0,0 +1,29 @@
upstream backend {
server backend:8080;
}
server {
listen 80;
listen [::]:80;
server_name ipv6.thehrz.net;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/json;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
location / {
proxy_pass http://frontend:3000;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
}
location ^~ /api/ {
proxy_pass http://backend/;
}
}

2
web

@ -1 +1 @@
Subproject commit 65b25e7ef3883695126228a3f98f3efdab07ef60
Subproject commit fe04e92e04edc6faefa87a3121cc287544df32bd