commit 0a32b8c060a979a459a39e264504ce32442f7f84 Author: vchikalkin Date: Mon Aug 28 11:34:57 2023 +0300 init diff --git a/.env b/.env new file mode 100644 index 0000000..fd72889 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +TRAEFIK_APP_NAME=evo_logger +TRAEFIK_NETWORK_NAME= + +URL_DOWNLOAD= +WEB_HOST= \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2047517 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + server: + extends: + file: docker.traefik.yml + service: server + image: nginx + volumes: + - ./nginx.conf:/etc/nginx/templates/default.conf.template + - ./html:/usr/share/nginx/html + restart: always + environment: + - URL_LOG=${URL_LOG} + networks: + - evo_logger_network + +networks: + evo_logger_network: + name: evo_logger_network + web: + external: true diff --git a/docker.traefik.yml b/docker.traefik.yml new file mode 100644 index 0000000..d453746 --- /dev/null +++ b/docker.traefik.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + server: + container_name: ${TRAEFIK_APP_NAME} + labels: + - 'traefik.enable=true' + - 'traefik.backend=${TRAEFIK_APP_NAME}' + - 'traefik.docker.network=web' + - 'traefik.http.routers.${TRAEFIK_APP_NAME}.rule=Host(`${WEB_HOST}`)' + - 'traefik.http.routers.${TRAEFIK_APP_NAME}.entrypoints=web-secure-ext' + - 'traefik.http.routers.${TRAEFIK_APP_NAME}.tls.certresolver=le' + - 'traefik.port=80' + networks: + - web diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..5fc5060 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,26 @@ + +server { + listen 80; + + gzip on; + gzip_min_length 1000; + gzip_proxied any; + gzip_comp_level 1; + gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml; + gzip_vary on; + gzip_disable "msie6"; + + include /etc/nginx/mime.types; + + + location /log { + auth_request /auth; + proxy_pass $URL_LOG; + } + + location = /health { + access_log off; + add_header 'Content-Type' 'application/json'; + return 200 'UP'; + } +} \ No newline at end of file