diff --git a/docker-compose.yml b/docker-compose.yml index d30e7b1..c90f6df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..b4f6aeb --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:stable-alpine +WORKDIR /nginx +COPY ./conf.d /etc/nginx/conf.d diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf new file mode 100644 index 0000000..f24652b --- /dev/null +++ b/nginx/conf.d/default.conf @@ -0,0 +1,6 @@ +server { + listen 80; + listen [::]:80; + + return 444; +} \ No newline at end of file diff --git a/nginx/conf.d/www.conf b/nginx/conf.d/www.conf new file mode 100644 index 0000000..2ef6f68 --- /dev/null +++ b/nginx/conf.d/www.conf @@ -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/; + } +} \ No newline at end of file diff --git a/web b/web index 65b25e7..fe04e92 160000 --- a/web +++ b/web @@ -1 +1 @@ -Subproject commit 65b25e7ef3883695126228a3f98f3efdab07ef60 +Subproject commit fe04e92e04edc6faefa87a3121cc287544df32bd