80 lines
2.3 KiB
YAML
80 lines
2.3 KiB
YAML
services:
|
|
nginx:
|
|
image: nginx:latest
|
|
hostname: nginx
|
|
ports:
|
|
- "80:80" # Expose HTTP traffic
|
|
volumes:
|
|
- ./conf/nginx-site.conf:/etc/nginx/conf.d/cmc.conf
|
|
# todo setup site config.
|
|
- ./userpasswd:/etc/nginx/userpasswd:ro
|
|
restart: unless-stopped
|
|
networks:
|
|
- cmc-network
|
|
|
|
cmc:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
platform: linux/amd64
|
|
|
|
depends_on:
|
|
- db
|
|
volumes:
|
|
- ./app/webroot/pdf:/var/www/cmc-sales/app/webroot/pdf
|
|
- ./app/webroot/attachments_files:/var/www/cmc-sales/app/webroot/attachments_files
|
|
networks:
|
|
- cmc-network
|
|
develop:
|
|
watch:
|
|
- action: rebuild
|
|
path: ./app
|
|
ignore:
|
|
- ./app/webroot
|
|
|
|
cmc-django: # Renamed service for clarity (optional, but good practice)
|
|
build: # Added build section
|
|
context: ./cmc-django # Path to the directory containing the Dockerfile
|
|
dockerfile: Dockerfile # Name of the Dockerfile
|
|
platform: linux/amd64 # Keep platform if needed for compatibility
|
|
container_name: cmc-django-web # Optional: Keep or change container name
|
|
command: uv run python cmcsales/manage.py runserver 0.0.0.0:8888 # Add command if needed
|
|
volumes:
|
|
- ./cmc-django:/app # Mount the Django project directory
|
|
# Keep other necessary volumes if they exist outside ./cmc-django
|
|
# Example: - ./app/webroot/pdf:/app/webroot/pdf # Adjust path if needed
|
|
# Example: - ./app/webroot/attachments_files:/app/webroot/attachments_files # Adjust path if needed
|
|
ports: # Add ports if the Django app needs to be accessed directly
|
|
- "8888:8888"
|
|
environment: # Add environment variables needed by Django
|
|
DJANGO_SETTINGS_MODULE: cmcsales.settings
|
|
DATABASE_HOST: db
|
|
DATABASE_PORT: 3306
|
|
DATABASE_NAME: cmc
|
|
DATABASE_USER: cmc
|
|
DATABASE_PASSWORD: xVRQI&cA?7AU=hqJ!%au
|
|
depends_on:
|
|
- db
|
|
networks:
|
|
- cmc-network
|
|
|
|
db:
|
|
image: mariadb:latest
|
|
container_name: cmc-db
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: secureRootPassword
|
|
MYSQL_DATABASE: cmc
|
|
MYSQL_USER: cmc
|
|
MYSQL_PASSWORD: xVRQI&cA?7AU=hqJ!%au
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
ports:
|
|
- "3306:3306"
|
|
networks:
|
|
- cmc-network
|
|
|
|
volumes:
|
|
db_data:
|
|
|
|
networks:
|
|
cmc-network: |