This commit is contained in:
Paul Brinkmeier 2021-11-15 03:24:59 +01:00
parent 0e9e7732b2
commit cb1179f686
4 changed files with 57 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.env

View File

@ -1,6 +1,13 @@
---
- hosts: misc
tasks:
- name: Install basic packages
become: yes
apt:
name:
- vim
- git
- htop
- include_role:
name: docker
- name: Install pip prerequisites
@ -22,11 +29,22 @@
copy:
src: ../docker
dest: /etc/pbri
- name: Create global docker volumes
become: yes
docker_volume:
name: "{{ item.name }}"
state: "{{ item.state }}"
loop:
- name: codi_database
state: present
- name: codi_uploads
state: present
- name: Set up docker stuff
become: yes
docker_compose:
project_src: "/etc/pbri/docker/{{ item.name }}"
state: "{{ item.state }}"
build: yes
debug: yes
loop:
- name: web

View File

@ -3,3 +3,7 @@ h2954114.stratoserver.net {
root /usr/share
}
}
codi.pbrinkmeier.de {
reverse_proxy codi:3000
}

View File

@ -1,6 +1,7 @@
version: "3"
services:
# Webserver for static files and reverse proxy
web:
image: pbrinkmeier/web
build: .
@ -12,6 +13,36 @@ services:
- caddy_config:/config
restart: always
codi:
image: hackmdio/hackmd:2.4.1
# CMD_DB_{URL,CMD_SESSION_SECRET}
env_file: codi.env
environment:
- CMD_USECDN=false
- CMD_DOMAIN=codi.pbrinkmeier.de
- CMD_PROTOCOL_USESSL=true
- CMD_EMAIL=true
- CMD_ALLOW_EMAIL_REGISTER=false
- CMD_ALLOW_ANONYMOUS_EDITS=true
depends_on:
- codi_db
volumes:
- codi_uploads:/home/hackmd/app/public/uploads
restart: always
codi_db:
image: postgres:11.6-alpine
# POSTGRES_{USER,PASSWORD,DB}
# Must match CMD_DB_URL in codi.env
env_file: codi_db.env
volumes:
- codi_database:/var/lib/postgresql/data
restart: always
volumes:
caddy_data:
caddy_config:
codi_uploads:
external: yes
codi_database:
external: yes