-
Notifications
You must be signed in to change notification settings - Fork 0
/
1
33 lines (30 loc) · 1.11 KB
/
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
services:
# Use a more descriptive service name
frontend:
build: ./Doctor-Patient-Portal # Build the frontend image from the current directory
ports:
- "8083:8083"
# Map container port 8085 to host port 8080 (standard HTTP)
environment:
- MYSQL_HOST=${MYSQL_HOST} # Use the service name of the database container
- MYSQL_NAME=${MYSQL_NAME} # Standard MySQL port # Add other environment variables from .env (see note)
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
depends_on:
- db # Ensure database is ready before starting frontend
# Use a more descriptive service name
db:
image: mysql:8.0 # Build the database image from the directory named 'db'
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} # Consider using a stronger password
- MYSQL_NAME=${MYSQL_NAME}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD","mysqladmin","ping"]
interval: 10s
timeout: 5s
retries: 3