writefreely/docker-compose.yml
Herzenschein bd657b247d
Update docker-compose.yml
A few QoL changes for readability and Podman correctness
2023-10-06 17:17:23 -03:00

45 lines
1.2 KiB
YAML

version: "3"
volumes:
web-keys:
db-data:
config.ini:
external: true
networks:
external_writefreely: # Used to expose WriteFreely to a reverse proxy for example
internal_writefreely: # Used for WriteFreely to communicate with the database
internal: true
services:
writefreely-web:
container_name: "writefreely-web"
image: "docker.io/writeas/writefreely:latest"
volumes:
- "web-keys:/go/keys:z"
- "./config.ini:/go/config.ini:Z"
networks:
- "internal_writefreely"
- "external_writefreely"
ports:
- "8080:8080"
depends_on:
- "writefreely-db"
restart: unless-stopped
writefreely-db:
container_name: "writefreely-db"
image: "docker.io/mariadb:latest"
volumes:
- "db-data:/var/lib/mysql/data:z"
networks:
- "internal_writefreely"
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=writefreelydb
- MYSQL_USER=writefreely
- MYSQL_PASSWORD=changeme
# MYSQL_HOST points to itself, which matches the container name
# "writefreely-db" for container DNS resolution
- MYSQL_HOST=localhost
restart: unless-stopped