Skip to content

Commit 96de496

Browse files
authored
Update docker-compose.yml
1 parent aa9aca0 commit 96de496

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

code/docker-compose.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
12
services:
23
app:
3-
container_name: my_django_app
4+
container_name: my_django_app # Specify the container name for the Django app
45
build:
56
context: .
67
dockerfile: Dockerfile
78
volumes:
8-
- ./requirements.txt:/app/requirements.txt
9-
- ./my_project:/app/my_project
9+
- ./requirements.txt:/app/requirements.txt # Mount requirements.txt from team3_docker
10+
- ./my_project:/app/my_project # Mount the my_project directory
11+
1012
ports:
1113
- "8000:8000"
1214
depends_on:
@@ -18,27 +20,29 @@ services:
1820
- DB_PASSWORD=snowBall
1921
- DB_HOST=db
2022
- DB_PORT=3306
21-
command: ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]
23+
command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]
24+
2225

2326
db:
24-
container_name: my_sql_db
27+
container_name: my_sql_db # Specify the container name for MySQL
2528
image: mysql:8.0
2629
environment:
2730
- MYSQL_DATABASE=movie_data
28-
- MYSQL_USER=selina
29-
- MYSQL_PASSWORD=snowBall
3031
- MYSQL_ROOT_PASSWORD=snowBall2024
32+
33+
3134
ports:
3235
- "3306:3306"
3336
volumes:
3437
- mysql_data:/var/lib/mysql
38+
- ./docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/ # Mount the SQL init folder
3539
healthcheck:
3640
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
3741
interval: 10s
3842
timeout: 5s
3943
retries: 5
4044
restart: always
4145
command: --default-authentication-plugin=mysql_native_password
42-
4346
volumes:
44-
mysql_data:
47+
mysql_data:
48+

0 commit comments

Comments
 (0)