This commit is contained in:
Herzenschein 2024-02-25 22:24:41 +03:30 committed by GitHub
commit d03f8e257d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 22 deletions

View File

@ -3,45 +3,43 @@ version: "3"
volumes: volumes:
web-keys: web-keys:
db-data: db-data:
config.ini:
external: true
networks: networks:
external_writefreely: external_writefreely: # Used to expose WriteFreely to a reverse proxy for example
internal_writefreely: internal_writefreely: # Used for WriteFreely to communicate with the database
internal: true internal: true
services: services:
writefreely-web: writefreely-web:
container_name: "writefreely-web" container_name: "writefreely-web"
image: "writeas/writefreely:latest" image: "docker.io/writeas/writefreely:latest"
volumes: volumes:
- "web-keys:/go/keys" - "web-keys:/go/keys:z"
- "./config.ini:/go/config.ini" - "./config.ini:/go/config.ini:Z"
networks: networks:
- "internal_writefreely" - "internal_writefreely"
- "external_writefreely" - "external_writefreely"
ports: ports:
- "8080:8080" - "8080:8080"
depends_on: depends_on:
- "writefreely-db" - "writefreely-db"
restart: unless-stopped restart: unless-stopped
writefreely-db: writefreely-db:
container_name: "writefreely-db" container_name: "writefreely-db"
image: "mariadb:latest" image: "docker.io/mariadb:latest"
volumes: volumes:
- "db-data:/var/lib/mysql/data" - "db-data:/var/lib/mysql/data:z"
networks: networks:
- "internal_writefreely" - "internal_writefreely"
environment: environment:
- MYSQL_DATABASE=writefreely - MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_ROOT_PASSWORD=changeme - 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 restart: unless-stopped

View File

@ -1,4 +0,0 @@
#!/bin/bash
docker-compose exec db sh -c 'exec mysql -u root -pchangeme writefreely < /tmp/schema.sql'
docker exec writefreely_web_1 writefreely --gen-keys
docker exec -it writefreely_web_1 writefreely --config