diff --git a/Dockerfile b/Dockerfile index e185381..7aa05c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ########################## BUILD IMAGE ########################## -# Alpine build image to build Conduits statically compiled binary +# Alpine build image to build Conduit's statically compiled binary FROM alpine:3.12 as builder # Specifies if the local project is build or if Conduit gets build @@ -51,7 +51,7 @@ LABEL org.opencontainers.image.created=${CREATED} \ org.opencontainers.image.vendor="Conduit Contributors" \ org.opencontainers.image.description="A Matrix homeserver written in Rust" \ org.opencontainers.image.url="https://conduit.rs/" \ - org.opencontainers.image.revision=$GIT_REF \ + org.opencontainers.image.revision=${GIT_REF} \ org.opencontainers.image.source="https://git.koesters.xyz/timo/conduit.git" \ org.opencontainers.image.documentation.="" \ org.opencontainers.image.licenses="AGPL-3.0" \ diff --git a/docker-compose.override.traefik.yml b/docker-compose.override.traefik.yml deleted file mode 100644 index 8b4be50..0000000 --- a/docker-compose.override.traefik.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Conduit - Traefik Reverse Proxy Labels -version: '3' - -services: - homeserver: - labels: - - "traefik.enable=true" - - "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network - - - "traefik.http.routers.to-conduit.rule=Host(`.`)" # Change to the address on which Conduit is hosted - - "traefik.http.routers.to-conduit.tls=true" - - "traefik.http.routers.to-conduit.tls.certresolver=letsencrypt" - - element-web: - labels: - - "traefik.enable=true" - - "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network - - - "traefik.http.routers.to-element-web.rule=Host(`.`)" # Change to the address on which Element-Web is hosted - - "traefik.http.routers.to-element-web.tls=true" - - "traefik.http.routers.to-element-web.tls.certresolver=letsencrypt" diff --git a/docker-compose.yml b/docker-compose.yml index 48470e6..afd3699 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,17 +3,18 @@ version: '3' services: homeserver: - ### If you already built the Conduit image with 'docker build', then you are ready to - ### go. Otherwise, you need to comment the 'image' line and uncomment the 'build' lines - ### and run: CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d - image: conduit_homeserver:latest - # build: - # context: . - # args: - # CREATED: - # VERSION: - # LOCAL: "false" - # GIT_REF: HEAD + ### If you already built the Conduit image with 'docker build', then you can uncomment the + ### 'image' line and comment out the 'build' option. + # image: conduit_homeserver:latest + ### If you want meaningful labels in you built Conduit image, you should run docker-compose like this: + ### CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d + build: + context: . + args: + CREATED: + VERSION: + LOCAL: "false" + GIT_REF: HEAD restart: unless-stopped ports: - 8448:8000 diff --git a/docker/docker-compose.override.traefik.yml b/docker/docker-compose.override.traefik.yml new file mode 100644 index 0000000..2096d79 --- /dev/null +++ b/docker/docker-compose.override.traefik.yml @@ -0,0 +1,22 @@ +# Conduit - Traefik Reverse Proxy Labels +version: '3' + +services: + homeserver: + labels: + - "traefik.enable=true" + - "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network + + - "traefik.http.routers.to-conduit.rule=Host(`.`)" # Change to the address on which Conduit is hosted + - "traefik.http.routers.to-conduit.tls=true" + - "traefik.http.routers.to-conduit.tls.certresolver=letsencrypt" + + ### Uncomment this if you uncommented Element-Web App in the docker-compose.yml + # element-web: + # labels: + # - "traefik.enable=true" + # - "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network + + # - "traefik.http.routers.to-element-web.rule=Host(`.`)" # Change to the address on which Element-Web is hosted + # - "traefik.http.routers.to-element-web.tls=true" + # - "traefik.http.routers.to-element-web.tls.certresolver=letsencrypt" diff --git a/docker-compose.traefik.yml b/docker/docker-compose.traefik.yml similarity index 77% rename from docker-compose.traefik.yml rename to docker/docker-compose.traefik.yml index 8edc29c..ad1dad8 100644 --- a/docker-compose.traefik.yml +++ b/docker/docker-compose.traefik.yml @@ -3,17 +3,18 @@ version: '3' services: homeserver: - ### If you already built the Conduit image with 'docker build', then you are ready to - ### go. Otherwise, you need to comment the 'image' line and uncomment the 'build' lines - ### and run: CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d - image: conduit_homeserver:latest - # build: - # context: . - # args: - # CREATED: - # VERSION: - # LOCAL: false - # GIT_REF: HEAD + ### If you already built the Conduit image with 'docker build', then you can uncomment the + ### 'image' line and comment out the 'build' option. + # image: conduit_homeserver:latest + ### If you want meaningful labels in you built Conduit image, you should run docker-compose like this: + ### CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d + build: + context: . + args: + CREATED: + VERSION: + LOCAL: false + GIT_REF: HEAD restart: unless-stopped volumes: - db:/srv/conduit/.local/share/conduit