development branch created to preserve working deploy project

This commit is contained in:
2025-08-02 17:37:16 +03:00
parent 5e65ea0f7c
commit e824e87953
659 changed files with 90008 additions and 137 deletions
+26 -22
View File
@@ -4,15 +4,15 @@ services:
database:
image: postgres
environment:
- POSTGRES_DB=depot # Matches DB_NAME in production.env
- POSTGRES_USER=postgres # Matches DB_USER in production.env
- POSTGRES_PASSWORD=admin # Matches DB_PASSWORD in production.env
- POSTGRES_DB=depot
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d depot"] # Check specific database
test: ["CMD-SHELL", "pg_isready -U postgres -d depot"]
interval: 5s
timeout: 5s
retries: 5
@@ -20,7 +20,10 @@ services:
- app-network
web:
build: .
image: depot-web
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
@@ -28,23 +31,27 @@ services:
depends_on:
database:
condition: service_healthy
minio:
condition: service_healthy
createbuckets:
condition: service_completed_successfully
networks:
- app-network
command: >
bash -c "python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
bash -c "sleep 10 &&\
python manage.py collectstatic --noinput --verbosity 3 &&\
python manage.py migrate &&\
gunicorn DepoT.wsgi:application --bind 0.0.0.0:8000 --workers 3"
minio:
image: minio/minio:latest
ports:
- "9000:9000" # API Port
- "9001:9001" # Console Port
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: kikimor # Change this
MINIO_ROOT_USER: kikimor
MINIO_ROOT_PASSWORD: shushunka1
MINIO_SERVER_URL: http://localhost:9000
MINIO_ADDRESS: "0.0.0.0:9000"
MINIO_BROWSER_REDIRECT_URL: "http://localhost:9001" # Console URL
volumes:
- minio_data:/data
command: server --console-address ":9001" /data
@@ -56,22 +63,19 @@ services:
networks:
- app-network
# Optional: Create buckets and users on startup
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
sleep 10;
sleep 10;
mc alias set myminio http://minio:9000 kikimor shushunka1;
mc mb myminio/damages;
mc anonymous set download myminio/damages;
mc policy set public myminio/damages;
echo '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::damages/*\"]}]}' > /tmp/policy.json;
mc admin policy add myminio getonly /tmp/policy.json;
mc admin policy set myminio getonly user=kikimor;
exit 0;
mc mb myminio/static;
mc anonymous set public myminio/damages;
mc anonymous set public myminio/static;
"
networks:
- app-network