sync
This commit is contained in:
+8
-16
@@ -14,34 +14,26 @@ services:
|
||||
# ⚠️ Use a secure Personal Access Token (PAT) for the URL
|
||||
- GIT_REPO_URL=https://${GITHUB_USER}:${GITHUB_PAT}@github.com/${GITHUB_USER}/${SPACES_REPO}.git
|
||||
- GIT_BRANCH=main
|
||||
|
||||
# --- Database Connection Settings (for your PHP app) ---
|
||||
- DB_HOST=db
|
||||
- DB_DATABASE=mydatabase
|
||||
- DB_USER=myuser
|
||||
- DB_PASSWORD=mypassword
|
||||
|
||||
# --- Backup Script Settings ---
|
||||
# These credentials are used by mysqldump inside the container
|
||||
- MARIADB_USER=${DB_USER}
|
||||
- MARIADB_PASSWORD=${DB_PASSWORD}
|
||||
- MARIADB_DATABASE=${DB_DATABASE}
|
||||
- MARIADB_HOST=db # The service name from this compose file
|
||||
depends_on:
|
||||
- db # Ensures the 'db' container starts before the 'app' container
|
||||
- spaces_db # Ensures the 'db' container starts before the 'app' container
|
||||
|
||||
db:
|
||||
image: mariadb:latest
|
||||
spaces_db:
|
||||
image: docker.io/mariadb:latest
|
||||
container_name: spaces_db
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
# Persists database data on the host machine
|
||||
- db_data:/var/lib/mysql
|
||||
environment:
|
||||
- MARIADB_ROOT_PASSWORD=supersecretrootpassword
|
||||
- MARIADB_DATABASE=mydatabase
|
||||
- MARIADB_USER=myuser
|
||||
- MARIADB_PASSWORD=mypassword
|
||||
- MARIADB_ROOT_PASSWORD=changeme
|
||||
- MARIADB_DATABASE=vintagecoding
|
||||
- MARIADB_USER=vintage
|
||||
- MARIADB_PASSWORD=changeme
|
||||
- MARIADB_EXTRA_DATABASES=vintagecoding_test
|
||||
ports:
|
||||
# Optional: Expose DB port to host for debugging with a GUI client
|
||||
- "3306:3306"
|
||||
|
||||
Reference in New Issue
Block a user