Files
scripts/compose.yaml
T
2026-08-25 12:24:49 -06:00

43 lines
1.3 KiB
YAML

---
services:
app:
build: .
container_name: spaces
ports:
- "2025:2025"
volumes:
# Mounts the project code into the container.
# This makes git pulls faster after the first run.
- ./web:/var/www/html
environment:
# --- Git Settings ---
# ⚠️ 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
- MARIADB_USER=${DB_USER}
- MARIADB_PASSWORD=${DB_PASSWORD}
- MARIADB_DATABASE=${DB_DATABASE}
- MARIADB_HOST=db # The service name from this compose file
depends_on:
- spaces_db # Ensures the 'db' container starts before the 'app' container
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=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"
volumes:
db_data: # Defines the named volume for the database