mirror of
https://github.com/Haxxnet/Compose-Examples.git
synced 2026-11-06 05:16:38 +00:00
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
services:
|
|
|
|
web:
|
|
image: nginx:stable-alpine
|
|
container_name: nginx
|
|
hostname: nginx
|
|
volumes:
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nginx/www-data:/var/www # place your files for web here
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nginx/nginx-conf:/etc/nginx/conf.d # place provided nginx.conf here
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nginx/logs:/var/log/nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- 8080:80
|
|
expose:
|
|
- 80
|
|
#networks:
|
|
# - proxy
|
|
#labels:
|
|
# - traefik.enable=true
|
|
# - traefik.docker.network=proxy
|
|
# - traefik.http.routers.nginx.rule=Host(`nginx.example.com`)
|
|
# - traefik.http.services.nginx.loadbalancer.server.port=80
|
|
# - traefik.http.services.nginx.loadbalancer.server.scheme=h2c # force http/2
|
|
# # Optional part for traefik middlewares
|
|
# #- traefik.http.routers.nginx.middlewares=error-pages-middleware@docker
|
|
|
|
php:
|
|
image: php:8-fpm-alpine
|
|
user: 82:82
|
|
container_name: php
|
|
hostname: php
|
|
volumes:
|
|
- php_tmp:/tmp
|
|
- php_run:/run
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nginx/www-data:/var/www # must be same path to www-data as above
|
|
#- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/php/custom-php.ini:/usr/local/etc/php/conf.d/php.ini:ro
|
|
restart: unless-stopped
|
|
working_dir: /var/www
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
read_only: true
|
|
pids_limit: 100
|
|
mem_limit: 512m
|
|
cpus: 1.0
|
|
expose:
|
|
- 9000
|
|
#networks:
|
|
# - proxy
|
|
|
|
#networks:
|
|
# proxy:
|
|
# external: true
|
|
|
|
volumes:
|
|
php_tmp:
|
|
php_run:
|