Adding docker for deployment
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- "8080:80"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DB_HOST: db
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: rootpassword
|
||||
# sig-01, sig-02, sig-03 databases are all created via init SQL below
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
ports:
|
||||
- "3306:3306" # optional: expose for local tools like TablePlus/DBeaver
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
Reference in New Issue
Block a user