|
|
|
|
@ -8,20 +8,28 @@
@@ -8,20 +8,28 @@
|
|
|
|
|
# Credit's for the original Dockerfile: Weasy666. |
|
|
|
|
# --------------------------------------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
FROM alpine:3.14 |
|
|
|
|
FROM docker.io/alpine:3.14 AS runner |
|
|
|
|
|
|
|
|
|
# Install packages needed to run Conduit |
|
|
|
|
# Standard port on which Conduit launches. |
|
|
|
|
# You still need to map the port when using the docker command or docker-compose. |
|
|
|
|
EXPOSE 6167 |
|
|
|
|
|
|
|
|
|
# Note from @jfowl: I would like to remove this in the future and just have the Docker version be configured with envs. |
|
|
|
|
ENV CONDUIT_CONFIG="/srv/conduit/conduit.toml" |
|
|
|
|
|
|
|
|
|
# Conduit needs: |
|
|
|
|
# ca-certificates: for https |
|
|
|
|
# curl: for the container's healtcheck |
|
|
|
|
# libgcc: Apparently this is needed, even if I (@jfowl) don't know exactly why. But whatever, it's not that big. |
|
|
|
|
RUN apk add --no-cache \ |
|
|
|
|
ca-certificates \ |
|
|
|
|
curl \ |
|
|
|
|
libgcc |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ARG CREATED |
|
|
|
|
ARG VERSION |
|
|
|
|
ARG GIT_REF |
|
|
|
|
|
|
|
|
|
ENV CONDUIT_CONFIG="/srv/conduit/conduit.toml" |
|
|
|
|
|
|
|
|
|
# Labels according to https://github.com/opencontainers/image-spec/blob/master/annotations.md |
|
|
|
|
# including a custom label specifying the build command |
|
|
|
|
LABEL org.opencontainers.image.created=${CREATED} \ |
|
|
|
|
@ -37,23 +45,21 @@ LABEL org.opencontainers.image.created=${CREATED} \
@@ -37,23 +45,21 @@ LABEL org.opencontainers.image.created=${CREATED} \
|
|
|
|
|
org.opencontainers.image.documentation="https://gitlab.com/famedly/conduit" \ |
|
|
|
|
org.opencontainers.image.ref.name="" |
|
|
|
|
|
|
|
|
|
# Standard port on which Conduit launches. You still need to map the port when using the docker command or docker-compose. |
|
|
|
|
EXPOSE 6167 |
|
|
|
|
|
|
|
|
|
# create data folder for database |
|
|
|
|
# Created directory for the database and media files |
|
|
|
|
RUN mkdir -p /srv/conduit/.local/share/conduit |
|
|
|
|
|
|
|
|
|
# Test if Conduit is still alive, uses the same endpoint as Element |
|
|
|
|
COPY ./docker/healthcheck.sh /srv/conduit/ |
|
|
|
|
HEALTHCHECK --start-period=5s --interval=20s CMD ./healthcheck.sh |
|
|
|
|
HEALTHCHECK --start-period=5s --interval=5s CMD ./healthcheck.sh |
|
|
|
|
|
|
|
|
|
# Copy the Conduit binary into the image at the latest possible moment to maximise caching: |
|
|
|
|
|
|
|
|
|
# depending on the target platform (e.g. "linux/arm/v7", "linux/arm64/v8", or "linux/amd64") |
|
|
|
|
# Depending on the target platform (e.g. "linux/arm/v7", "linux/arm64/v8", or "linux/amd64") |
|
|
|
|
# copy the matching binary into this docker image |
|
|
|
|
ARG TARGETPLATFORM |
|
|
|
|
COPY ./$TARGETPLATFORM /srv/conduit/conduit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Improve security: Don't run stuff as root, that does not need to run as root: |
|
|
|
|
# Add www-data user and group with UID 82, as used by alpine |
|
|
|
|
# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install |
|
|
|
|
RUN set -x ; \ |
|
|
|
|
@ -65,7 +71,7 @@ RUN set -x ; \
@@ -65,7 +71,7 @@ RUN set -x ; \
|
|
|
|
|
RUN chown -cR www-data:www-data /srv/conduit |
|
|
|
|
RUN chmod +x /srv/conduit/healthcheck.sh |
|
|
|
|
|
|
|
|
|
# Set user to www-data |
|
|
|
|
# Change user to www-data |
|
|
|
|
USER www-data |
|
|
|
|
# Set container home directory |
|
|
|
|
WORKDIR /srv/conduit |
|
|
|
|
|