diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 6850c3c..71f880d 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -21,7 +21,20 @@ services: {% if paperless_db_host == 'postgres' %} # Postgres # + postgres-init: + image: docker.io/library/postgres:{{ paperless_image_version_db }} + volumes: + - "{{ paperless_volume_db }}:/data" + entrypoint: + - sh + - -c + - | + chown -R 70:70 /data + postgres: + depends_on: + postgres-init: + condition: service_completed_successfully image: docker.io/library/postgres:{{ paperless_image_version_db }} env_file: - "{{ paperless_setup_path | expanduser }}/env.db.conf"