Updated docker-compose to remove dev build. Fix mysql socket issue w
settings.py and db_data volume location.
This commit is contained in:
parent
91832fd5bc
commit
2a3574652f
2 changed files with 20 additions and 17 deletions
|
|
@ -1,5 +1,3 @@
|
|||
version: "3.8"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mysql:8.0
|
||||
|
|
@ -12,19 +10,22 @@ services:
|
|||
- "3306:3306"
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
# can't store db_data locally, breaks mysql.sock link
|
||||
networks:
|
||||
- workout_net
|
||||
|
||||
web:
|
||||
build: .
|
||||
#build: .
|
||||
# removed build. added image
|
||||
image: workouts_web:latest
|
||||
container_name: workouts_web
|
||||
working_dir: /app/zed_workouts
|
||||
command: >
|
||||
sh -c "sleep 10 &&
|
||||
python manage.py migrate &&
|
||||
python manage.py runserver 0.0.0.0:8001"
|
||||
volumes:
|
||||
- .:/app
|
||||
#volumes:
|
||||
# .:/app
|
||||
ports:
|
||||
- "8001:8001"
|
||||
depends_on:
|
||||
|
|
@ -39,6 +40,7 @@ services:
|
|||
|
||||
volumes:
|
||||
db_data:
|
||||
|
||||
networks:
|
||||
workout_net:
|
||||
#sudo docker compose up -d --build
|
||||
#sudo docker build -t workouts_web:latest .
|
||||
|
|
|
|||
|
|
@ -95,17 +95,18 @@ DATABASES = {
|
|||
|
||||
# Database connector for local mysql instance
|
||||
# DATABASES = {
|
||||
# "default": {
|
||||
# "ENGINE": "django.db.backends.mysql",
|
||||
# "NAME": "workouts",
|
||||
# "USER": "root",
|
||||
# "PASSWORD": "Throwaway",
|
||||
# "HOST": "localhost", # Or your DB server IP
|
||||
# "PORT": "3306", # Default MySQL port
|
||||
# "OPTIONS": {
|
||||
# "init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
|
||||
# },
|
||||
# }
|
||||
# "default": {
|
||||
# "ENGINE": "django.db.backends.mysql",
|
||||
# "NAME": "workouts",
|
||||
# "USER": "root",
|
||||
# "PASSWORD": "Throwaway",
|
||||
# "HOST": "127.0.0.1", # Or your DB server IP
|
||||
# "PORT": "3306", # Default MySQL port
|
||||
# "OPTIONS": {
|
||||
# "init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
|
||||
# },
|
||||
# }
|
||||
# }
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue