version: "3.4"
services:
php-fpm:
container_name: php-fpm
build: ./settings/php-fpm/
working_dir: /app
restart: always
volumes:
- ./app-data:/app
env_file:
- .env
depends_on:
- database
networks:
- app-network
nginx:
container_name: nginx
image: nginx:1.19-alpine
restart: always
tty: true
command: nginx -g "daemon off;"
ports:
- 80:80
- 443:443
volumes:
- ./app-data:/app
- ./settings/nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./certbot-data:/etc/letsencrypt
depends_on:
- php-fpm
networks:
- app-network
redis:
container_name: redis
image: redis:6.0-alpine
restart: always
ports:
- 6379:6379
volumes:
- ./redis-data:/data
depends_on:
- php-fpm
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3.8-management
restart: always
privileged: true
env_file:
- .env
ports:
- 5672:5672
- 15672:15672
depends_on:
- php-fpm
volumes:
- ./rabbitmq-data:/var/lib/rabbitmq/
database:
container_name: database
image: mysql:8
restart: always
volumes:
- ./database-data:/var/lib/mysql
- ./settings/mysql/config.cnf:/etc/mysql/conf.d/config.cnf
ports:
- 3306:3306
env_file:
- .env
networks:
- app-network
adminer:
container_name: adminer
image: adminer
restart: always
links:
- database:db
depends_on:
- database
ports:
- 8080:8080
networks:
- app-network
database_postgres:
image: postgres
container_name: database_postgres
env_file:
- .env
volumes:
- ./postgress-data:/var/lib/postgresql/data
ports:
- 3307:3307
networks:
- app-network
sentry:
image: sentry
container_name: sentry
links:
- redis
- database_postgres
ports:
- 5000:5000
env_file:
- .env
depends_on:
- redis
networks:
- app-network
sentry_cron:
image: sentry
container_name: sentry_cron
depends_on:
- sentry
links:
- redis
- database_postgres
command: "sentry run cron"
env_file:
- .env
networks:
- app-network
sentry_worker:
image: sentry
container_name: sentry_worker
depends_on:
- sentry
links:
- redis
- database_postgres
command: "sentry run worker"
env_file:
- .env
networks:
- app-network
# certbot:
# depends_on:
# - nginx
# image: certbot/certbot
# container_name: certbot
# volumes:
# - ./certbot-data:/etc/letsencrypt
# - ./app-data:/app
# command: certonly --webroot --webroot-path=/app --email tarrissarh@gmail.com --agree-tos --no-eff-email --staging -d localhost -d app.local -d www.app.local
# mongo:
# image: mongo:4.0
# restart: always
# ports:
# - "27100:27017" # map port to none standard port, to avoid conflicts with locally installed mongodb.
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# # отключение логов
# logging:
# driver: none
# environment:
# MONGO_INITDB_ROOT_USERNAME: app
# MONGO_INITDB_ROOT_PASSWORD: app
# mongo-express:
# image: mongo-express:latest-alpine
# depends_on:
# - mongo
networks:
app-network:
driver: bridge