summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJonas Zohren <git-pbkyr@jzohren.de>2022-02-22 15:22:53 +0000
committerJonas Zohren <git-pbkyr@jzohren.de>2022-02-22 16:26:30 +0100
commita5bb6786c8688134c5f6df3ed3c02ef85eb9f14e (patch)
treefa5718b7b12d93feea490a82184908e7df122d1e /docker
parent237645e975dbb6ac4b2b0e4afa1f645465d37393 (diff)
downloadconduit-a5bb6786c8688134c5f6df3ed3c02ef85eb9f14e.zip
fix(docker): Make conduit own default db path
When a user mounts a volume into the default volume path, it uses the permissions and ownership from the host volume. In most cases, this is 1000:1000, which it also uses on the inside. If you don't mount a volume though (e.g., for testing), conduit cries: “The database couldn't be loaded or created.” This fix chowns the default db dir to remedy this.
Diffstat (limited to 'docker')
-rw-r--r--docker/ci-binaries-packaging.Dockerfile6
1 files changed, 3 insertions, 3 deletions
diff --git a/docker/ci-binaries-packaging.Dockerfile b/docker/ci-binaries-packaging.Dockerfile
index ee1ca4c..6defc3d 100644
--- a/docker/ci-binaries-packaging.Dockerfile
+++ b/docker/ci-binaries-packaging.Dockerfile
@@ -48,8 +48,6 @@ LABEL org.opencontainers.image.created=${CREATED} \
org.opencontainers.image.documentation="https://gitlab.com/famedly/conduit" \
org.opencontainers.image.ref.name=""
-# Created directory for the database and media files
-RUN mkdir -p ${DEFAULT_DB_PATH}
# Test if Conduit is still alive, uses the same endpoint as Element
COPY ./docker/healthcheck.sh /srv/conduit/healthcheck.sh
@@ -67,7 +65,9 @@ RUN set -x ; \
# Change ownership of Conduit files to conduit user and group
RUN chown -cR conduit:conduit /srv/conduit && \
- chmod +x /srv/conduit/healthcheck.sh
+ chmod +x /srv/conduit/healthcheck.sh && \
+ mkdir -p ${DEFAULT_DB_PATH} && \
+ chown -cR conduit:conduit ${DEFAULT_DB_PATH}
# Change user to conduit
USER conduit