Updated docker-compose to remove dev build. Fix mysql socket issue w

settings.py and db_data volume location.
This commit is contained in:
Cory 2026-03-22 08:35:06 -06:00
parent 91832fd5bc
commit 2a3574652f
2 changed files with 20 additions and 17 deletions

View file

@ -1,5 +1,3 @@
version: "3.8"
services: services:
db: db:
image: mysql:8.0 image: mysql:8.0
@ -12,19 +10,22 @@ services:
- "3306:3306" - "3306:3306"
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
# can't store db_data locally, breaks mysql.sock link
networks: networks:
- workout_net - workout_net
web: web:
build: . #build: .
# removed build. added image
image: workouts_web:latest
container_name: workouts_web container_name: workouts_web
working_dir: /app/zed_workouts working_dir: /app/zed_workouts
command: > command: >
sh -c "sleep 10 && sh -c "sleep 10 &&
python manage.py migrate && python manage.py migrate &&
python manage.py runserver 0.0.0.0:8001" python manage.py runserver 0.0.0.0:8001"
volumes: #volumes:
- .:/app # .:/app
ports: ports:
- "8001:8001" - "8001:8001"
depends_on: depends_on:
@ -39,6 +40,7 @@ services:
volumes: volumes:
db_data: db_data:
networks: networks:
workout_net: workout_net:
#sudo docker compose up -d --build
#sudo docker build -t workouts_web:latest .

View file

@ -100,12 +100,13 @@ DATABASES = {
# "NAME": "workouts", # "NAME": "workouts",
# "USER": "root", # "USER": "root",
# "PASSWORD": "Throwaway", # "PASSWORD": "Throwaway",
# "HOST": "localhost", # Or your DB server IP # "HOST": "127.0.0.1", # Or your DB server IP
# "PORT": "3306", # Default MySQL port # "PORT": "3306", # Default MySQL port
# "OPTIONS": { # "OPTIONS": {
# "init_command": "SET sql_mode='STRICT_TRANS_TABLES'", # "init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
# }, # },
# } # }
# }
# Password validation # Password validation
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators