add compose file and env example

This commit is contained in:
James 2022-03-15 17:41:01 +00:00
parent 065e0c4795
commit 01d36a78fc
3 changed files with 56 additions and 0 deletions

10
.env.example Normal file
View File

@ -0,0 +1,10 @@
# Docker settings
DOCKER_PROXY_NETWORK=proxy
DOCKER_PROXY_EXT=true
VOLUME_PATH=/data/wikijs
# Postgres settings
POSTGRES_TAG=11-alpine
# Wiki.js settings
WIKI_TAG=2

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
secrets/postgres_password.txt
.env

44
docker-compose.yaml Normal file
View File

@ -0,0 +1,44 @@
secrets:
postgres_password:
file: ./secrets/postgres_password.txt
networks:
frontend:
external: ${DOCKER_PROXY_EXT-true}
name: ${DOCKER_PROXY_NETWORK}
backend:
services:
db:
image: postgres:${POSTGRES_TAG}
restart: unless-stopped
volumes:
- ${VOLUME_PATH}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
secrets:
- postgres_password
networks:
- backend
environment:
POSTGRES_DB: wiki
POSTGRES_USER: wikijs
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
wiki:
image: ghcr.io/requarks/wiki:${WIKI_TAG}
secrets:
- postgres_password
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS_FILE: /run/secrets/postgres_password
DB_NAME: wiki
networks:
- backend
- frontend
restart: unless-stopped
# ports: # Uncomment to expore port on host
# - "80:3000"
depends_on:
- db