fix data directory binding

This commit is contained in:
Malte 2024-12-15 20:09:12 +01:00
parent 8c65e5f0d4
commit f29bd6f6c3

View file

@ -3,6 +3,11 @@ hedgedoc data directory exists:
- name: /opt/hedgedoc/pg_data - name: /opt/hedgedoc/pg_data
- makedirs: True - makedirs: True
hedgedoc uploads directory exists:
file.directory:
- name: /opt/hedgedoc/uploads
- makedirs: True
hedgedoc_docker_net_present: hedgedoc_docker_net_present:
docker_network.present: docker_network.present:
- name: hedgedoc - name: hedgedoc
@ -13,7 +18,7 @@ hedgedoc_docker_present:
- image: {{ salt['pillar.get']('hedgedoc:image:path', 'quay.io/hedgedoc/hedgedoc') }}:{{ salt['pillar.get']('hedgedoc:image:version', '1.10.0') }} - image: {{ salt['pillar.get']('hedgedoc:image:path', 'quay.io/hedgedoc/hedgedoc') }}:{{ salt['pillar.get']('hedgedoc:image:version', '1.10.0') }}
- container: hedgedoc - container: hedgedoc
- environment: - environment:
- CMD_DB_URL: "postgres://codimd:password@database:5432/codimd" - CMD_DB_URL: "postgres://codimd:password@hedgedocdatabase:5432/codimd"
- CMD_USECDN: "false" - CMD_USECDN: "false"
- CMD_DOMAIN: "pad.flipdot.org" - CMD_DOMAIN: "pad.flipdot.org"
- CMD_URL_ADDPORT: "false" - CMD_URL_ADDPORT: "false"
@ -35,7 +40,7 @@ hedgedoc_docker_present:
- CMD_OAUTH2_SCOPE: "openid email profile" - CMD_OAUTH2_SCOPE: "openid email profile"
- networks: - networks:
- hedgedoc - hedgedoc
- volumes: - binds:
- /opt/hedgedoc/uploads:/hedgedoc/public/uploads - /opt/hedgedoc/uploads:/hedgedoc/public/uploads
- port_bindings: - port_bindings:
- "{{ salt['pillar.get']('hedgedoc:container_web_port', "127.0.0.1:3000") }}:3000" - "{{ salt['pillar.get']('hedgedoc:container_web_port', "127.0.0.1:3000") }}:3000"
@ -43,7 +48,7 @@ hedgedoc_docker_present:
hedgedoc_database_present: hedgedoc_database_present:
docker_container.running: docker_container.running:
- name: database - name: hedgedocdatabase
- image: postgres:{{ salt['pillar.get']('hedgedoc:postgres:version', '16-alpine') }} - image: postgres:{{ salt['pillar.get']('hedgedoc:postgres:version', '16-alpine') }}
- environment: - environment:
- POSTGRES_USER: codimd - POSTGRES_USER: codimd
@ -51,6 +56,6 @@ hedgedoc_database_present:
- POSTGRES_DB: codimd - POSTGRES_DB: codimd
- networks: - networks:
- hedgedoc - hedgedoc
- volumes: - binds:
- /opt/hedgedoc/pg_data:/var/lib/postgresql/data - /opt/hedgedoc/pg_data:/var/lib/postgresql/data
- restart: always - restart: always