unkown commit
This commit is contained in:
@@ -1,58 +1,66 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# 🐘 Cassandra Database Container
|
||||
cassandra:
|
||||
image: cassandra:latest
|
||||
container_name: cassandra-db
|
||||
image: cassandra:4.1
|
||||
container_name: cassandra
|
||||
ports:
|
||||
# Map the CQL native protocol port (required for client connections)
|
||||
- '9042:9042'
|
||||
volumes:
|
||||
# Optional: Persist data outside the container
|
||||
- ./docker/cassandra:/var/lib/cassandra
|
||||
- "9042:9042"
|
||||
environment:
|
||||
# Set the cluster name (optional, but good practice)
|
||||
- CASSANDRA_CLUSTER_NAME=MainCluster
|
||||
# Set the IP address of the node for other nodes to connect to
|
||||
- CASSANDRA_BROADCAST_ADDRESS=cassandra-db
|
||||
# Set the seed provider to itself for a single-node setup
|
||||
- CASSANDRA_SEEDS=cassandra-db
|
||||
- CASSANDRA_CLUSTER_NAME=EventStoreCluster
|
||||
- CASSANDRA_DC=dc1
|
||||
- CASSANDRA_RACK=rack1
|
||||
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
|
||||
- MAX_HEAP_SIZE=512M
|
||||
- HEAP_NEWSIZE=128M
|
||||
volumes:
|
||||
- ./docker/cassandra/data:/var/lib/cassandra
|
||||
- ./docker/cassandra/commitlog:/var/lib/cassandra/commitlog
|
||||
- ./docker/cassandra/hints:/var/lib/cassandra/hints
|
||||
- ./docker/cassandra/saved_caches:/var/lib/cassandra/saved_caches
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "cqlsh -e 'describe cluster' || exit 1" ]
|
||||
test: ["CMD-SHELL", "cqlsh -e 'describe cluster'"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
restart: always
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
# PHP-FPM Container
|
||||
app:
|
||||
php:
|
||||
build:
|
||||
context: ./docker/php
|
||||
dockerfile: Docker
|
||||
container_name: php-app
|
||||
# Mount the source code into the container's web root
|
||||
dockerfile: Dockerfile
|
||||
container_name: php-fpm
|
||||
volumes:
|
||||
- ./src:/var/www/html
|
||||
# PHP-FPM runs on port 9000 by default
|
||||
expose:
|
||||
- '9000'
|
||||
- ./src:/var/www/html/src
|
||||
- ./vendor:/var/www/html/vendor
|
||||
- ./logs:/var/www/html/logs
|
||||
- ./composer.json:/var/www/html/composer.json
|
||||
- ./.env:/var/www/html/.env
|
||||
environment:
|
||||
- APP_ENV=${APP_ENV:-production}
|
||||
- APP_DEBUG=${APP_DEBUG:-false}
|
||||
- CASSANDRA_HOST=cassandra
|
||||
- CASSANDRA_PORT=9042
|
||||
depends_on:
|
||||
cassandra:
|
||||
condition: service_healthy
|
||||
restart: always
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
# Nginx Web Server Container
|
||||
nginx:
|
||||
image: nginx:stable-alpine
|
||||
container_name: nginx-web
|
||||
image: nginx:alpine
|
||||
container_name: nginx
|
||||
ports:
|
||||
# Map host port 10010 to container port 80
|
||||
- '10010:80'
|
||||
- "8080:80"
|
||||
volumes:
|
||||
# Mount the source code (same path as PHP-FPM)
|
||||
- ./src:/var/www/html
|
||||
# Override Nginx default configuration
|
||||
- ./src:/var/www/html/src
|
||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
- app
|
||||
restart: always
|
||||
- php
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user