Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3.4"
- networks:
- default:
- external:
- name: traefik_webgateway
- services:
- php-fpm:
- env_file: .env.local
- build: # Info to build the Docker image
- context: . # Specify where the Dockerfile is located (e.g. in the root directory of the project)
- dockerfile: ./docker/Dockerfile-php # Specify the name of the Dockerfile
- labels:
- - traefik.enable=false
- volumes:
- - ./:/var/www/project/ # Location of the project for php-fpm. Note this should be the same for NGINX.
- - ./docker/php/php.ini:/usr/local/etc/php/php.ini
- container_name: php-fpm
- restart: on-failure
- command: >
- bash -c "php bin/console doctrine:database:drop --force \
- && php bin/console doctrine:database:create \
- && php bin/console doctrine:migrations:migrate --no-interaction \
- && php bin/console hautelook:fixtures:load -n \
- && php bin/console cache:clear \
- && yarn install \
- && yarn encore dev \
- ; php-fpm"
- depends_on:
- - db
- nginx:
- image: nginx:latest
- volumes:
- - ./:/var/www/project/
- - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ports:
- - 8000:80 # Ports that are exposed, you can connect to port 8000 to port 80 of the container.
- container_name: nginx
- depends_on:
- - php-fpm
- links:
- - php-fpm
- labels:
- - traefik.web.frontend.rule=Host:gooddeeds.md.localhost
- - traefik.admin.frontend.rule=Host:cms.gooddeeds.md.localhost
- db:
- env_file: .env.local
- image: postgres:11
- labels:
- - traefik.enable=false
- restart: on-failure
- working_dir: /var/www/project
- environment:
- POSTGRES_DB: ${DB_NAME}
- POSTGRES_USER: ${DB_USER}
- PGUSER: ${DB_USER}
- POSTGRES_PASSWORD: ${DB_PASS}
- volumes:
- - faptebune_db:/var/lib/postgresql/data # Persist the database in a Docker volume.
- ports:
- - 5432:5432
- container_name: postgres
- healthcheck:
- test: ["CMD", "pg_isready"]
- interval: 10s
- timeout: 2s
- retries: 3
- composer:
- image: composer:latest
- command: >
- bash -c "composer install && composer dumpautoload -o"
- labels:
- - traefik.enable=false
- restart: on-failure
- environment:
- - GIT_SSH_COMMAND=ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
- container_name: php-composer
- volumes:
- - ./:/app
- volumes:
- faptebune_db:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement