diff --git a/hedgedoc/init.sls b/hedgedoc/init.sls index 332698a..b072e3a 100644 --- a/hedgedoc/init.sls +++ b/hedgedoc/init.sls @@ -3,6 +3,11 @@ hedgedoc data directory exists: - name: /opt/hedgedoc/pg_data - makedirs: True +hedgedoc uploads directory exists: + file.directory: + - name: /opt/hedgedoc/uploads + - makedirs: True + hedgedoc_docker_net_present: docker_network.present: - 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') }} - container: hedgedoc - environment: - - CMD_DB_URL: "postgres://codimd:password@database:5432/codimd" + - CMD_DB_URL: "postgres://codimd:password@hedgedocdatabase:5432/codimd" - CMD_USECDN: "false" - CMD_DOMAIN: "pad.flipdot.org" - CMD_URL_ADDPORT: "false" @@ -35,7 +40,7 @@ hedgedoc_docker_present: - CMD_OAUTH2_SCOPE: "openid email profile" - networks: - hedgedoc - - volumes: + - binds: - /opt/hedgedoc/uploads:/hedgedoc/public/uploads - port_bindings: - "{{ salt['pillar.get']('hedgedoc:container_web_port', "127.0.0.1:3000") }}:3000" @@ -43,7 +48,7 @@ hedgedoc_docker_present: hedgedoc_database_present: docker_container.running: - - name: database + - name: hedgedocdatabase - image: postgres:{{ salt['pillar.get']('hedgedoc:postgres:version', '16-alpine') }} - environment: - POSTGRES_USER: codimd @@ -51,6 +56,6 @@ hedgedoc_database_present: - POSTGRES_DB: codimd - networks: - hedgedoc - - volumes: + - binds: - /opt/hedgedoc/pg_data:/var/lib/postgresql/data - restart: always