28 lines
696 B
YAML
28 lines
696 B
YAML
version: "3.9"
|
|
|
|
services:
|
|
nginx:
|
|
container_name: mynginx
|
|
build:
|
|
context: . # mappen där Dockerfile finns
|
|
dockerfile: Dockerfile # din Dockerfile (från frågan)
|
|
ports:
|
|
- "80:80" # exponerar HTTP till HAProxy
|
|
restart: unless-stopped
|
|
networks:
|
|
- web
|
|
- infra-net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -q -O- http://localhost/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
networks:
|
|
web:
|
|
external: true # använder redan befintligt nät
|
|
name: web
|
|
infra-net:
|
|
external: true # använder redan befintligt nät
|
|
name: infra-net
|