Задание 2 докер

This commit is contained in:
Данил Смелянец 2025-12-04 21:56:41 +03:00
parent 53767505d9
commit d5a7ff11df
2 changed files with 34 additions and 0 deletions

18
docker-compose.yml Normal file
View File

@ -0,0 +1,18 @@
version: "3.9"
services:
web:
build: .
container_name: web-app
expose:
- "80"
nginx:
image: nginx:alpine
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- web

16
nginx.conf Normal file
View File

@ -0,0 +1,16 @@
upstream web_app {
server web:80;
}
server {
listen 80;
location / {
proxy_pass http://web_app;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}