printshopcreator/.docker/docker-compose/docker-compose.local.yml
2025-01-24 10:14:08 +01:00

134 lines
3.6 KiB
YAML

version: '3.7'
networks:
network:
driver: ${NETWORKS_DRIVER?}
volumes:
mysql:
name: mysql-${ENV?}
driver: ${VOLUMES_DRIVER?}
mongodb:
name: mongodb-${ENV?}
driver: ${VOLUMES_DRIVER?}
services:
php-fpm:
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG?}
# cap_add and security_opt are required to enable strace
# @see https://stackoverflow.com/a/46676868
cap_add:
- "SYS_PTRACE"
security_opt:
- "seccomp=unconfined"
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
networks:
- network
extra_hosts:
- host.docker.internal:host-gateway
php-cron:
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG?}
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
networks:
- network
cap_add:
- "SYS_PTRACE"
security_opt:
- "seccomp=unconfined"
extra_hosts:
- host.docker.internal:host-gateway
web:
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
ports:
- "${NGINX_HOST_HTTP_PORT:-80}:80"
- "${NGINX_HOST_HTTPS_PORT:-443}:443"
networks:
network:
aliases:
- ${APP_HOST?}
depends_on:
- php-fpm
chrome:
image: selenium/standalone-chrome:latest
ports:
- "7900:7900"
- "4444:4444"
networks:
- network
smtp4dev:
image: registry.thomas-peterson.de/smtp4dev
restart: always
ports:
# Change the number before : to the port the web interface should be accessible on
- '5000:80'
# Change the number before : to the port the SMTP server should be accessible on
- '25:25'
# Change the number before : to the port the IMAP server should be accessible on
- '143:143'
environment:
- ServerOptions__Urls=http://*:80
- ServerOptions__HostName=smtp4dev
networks:
- network
application:
image: ${DOCKER_REGISTRY?}/${DOCKER_NAMESPACE?}/application-${ENV?}:${TAG?}
build:
context: ../
platforms:
- "linux/amd64"
#- "linux/arm64"
dockerfile: ./images/php/application/Dockerfile
args:
- BASE_IMAGE=${DOCKER_REGISTRY?}/${DOCKER_NAMESPACE?}/php-base-${ENV?}:${TAG?}
- APP_SSH_PASSWORD=${APP_SSH_PASSWORD?}
- ENV=${ENV?}
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG?}
# cap_add and security_opt are required to enable strace
# @see https://stackoverflow.com/a/46676868
cap_add:
- "SYS_PTRACE"
security_opt:
- "seccomp=unconfined"
volumes:
- ${APPLICATION_CODE_PATH_HOST?}:${APPLICATION_CODE_PATH_CONTAINER?}
ports:
- "${APPLICATION_SSH_HOST_PORT:-2222}:22"
- "${APPLICATION_PANTHER_HOST_PORT:-9001}:9001"
tty: true
networks:
- network
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- chrome
mongodb:
image: mongo:${MONGODB_VERSION?}
volumes:
- mongodb:/data/db
networks:
- network
ports:
- "127.0.0.1:27017:27017"
mysql:
image: mariadb:${MYSQL_VERSION?}
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE:-application_db}
- MYSQL_USER=${MYSQL_USER:-application_user}
- MYSQL_PASSWORD=${MYSQL_PASSWORD?}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD?}
- TZ=${TIMEZONE:-UTC}
volumes:
- mysql:/var/lib/mysql
command: mysqld --sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" --character-set-server=utf8 --collation-server=utf8_slovenian_ci --innodb-flush-log-at-trx-commit=0
networks:
- network
ports:
- "127.0.0.1:3306:3306"