fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


docker:compose

This is an old revision of the document!


Docker Compose

Befehle

docker-compose up -d
docker-compose down
docker-compose restart
docker-compose logs
docker-compose logs -f

Dateien

docker-compose.yml
docker-compose.override.yml

Beispiel Configs

Nginx + PHP

docker-compose.yml

version: '3.8'

services:
  nginx-web:
    image: nginx
    volumes:
      - /var/www/html:/var/www/html:ro,z
      - ./data/etc/nginx/conf.d:/etc/nginx/conf.d:ro
    ports:
      - "127.0.0.1:8000:8000"
    environment:
      - VIRTUAL_HOST=example.com
      - VIRTUAL_PORT=8000
      - VIRTUAL_PROTO=http
      - LETSENCRYPT_HOST=example.com
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      nginx-proxy:
        aliases:
          - nginx-web

  nginx-php:
    image: php:7.4-fpm
    volumes:
      - /var/www/html/example.com:/var/www/html/example.com

networks:
  nginx-proxy:
    external: true
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.  More information about cookies 
docker/compose.1621813721.txt.gz · Last modified: 2024/02/17 19:03 (external edit)