diff --git a/docker/Dockerfile.j2 b/docker/Dockerfile.j2 index 877fd74f..ace9d6df 100644 --- a/docker/Dockerfile.j2 +++ b/docker/Dockerfile.j2 @@ -204,8 +204,10 @@ RUN cargo build --features ${DB} --release --target=armv7-unknown-linux-gnueabih # because we already have a binary built FROM {{ runtime_stage_base_image }} +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 {% if "alpine" in runtime_stage_base_image %} ENV SSL_CERT_DIR=/etc/ssl/certs @@ -252,8 +254,8 @@ RUN [ "cross-build-end" ] {% endif %} VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile index 7a5663a9..62c684ed 100644 --- a/docker/amd64/Dockerfile +++ b/docker/amd64/Dockerfile @@ -68,8 +68,10 @@ RUN cargo build --features ${DB} --release # because we already have a binary built FROM debian:buster-slim +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 # Install needed libraries @@ -85,8 +87,8 @@ RUN apt-get update && apt-get install -y \ RUN mkdir /data VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage diff --git a/docker/amd64/Dockerfile.alpine b/docker/amd64/Dockerfile.alpine index 2804ef4a..1d0843fc 100644 --- a/docker/amd64/Dockerfile.alpine +++ b/docker/amd64/Dockerfile.alpine @@ -66,8 +66,10 @@ RUN cargo build --features ${DB} --release --target=x86_64-unknown-linux-musl # because we already have a binary built FROM alpine:3.12 +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 ENV SSL_CERT_DIR=/etc/ssl/certs @@ -79,8 +81,8 @@ RUN apk add --no-cache \ RUN mkdir /data VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage diff --git a/docker/arm32v6/Dockerfile b/docker/arm32v6/Dockerfile index 9a2918b1..dc8339eb 100644 --- a/docker/arm32v6/Dockerfile +++ b/docker/arm32v6/Dockerfile @@ -87,8 +87,10 @@ RUN cargo build --features ${DB} --release --target=arm-unknown-linux-gnueabi # because we already have a binary built FROM balenalib/rpi-debian:buster +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 RUN [ "cross-build-start" ] @@ -107,8 +109,8 @@ RUN mkdir /data RUN [ "cross-build-end" ] VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage diff --git a/docker/arm32v7/Dockerfile b/docker/arm32v7/Dockerfile index acc7ac73..4e120c3b 100644 --- a/docker/arm32v7/Dockerfile +++ b/docker/arm32v7/Dockerfile @@ -87,8 +87,10 @@ RUN cargo build --features ${DB} --release --target=armv7-unknown-linux-gnueabih # because we already have a binary built FROM balenalib/armv7hf-debian:buster +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 RUN [ "cross-build-start" ] @@ -107,8 +109,8 @@ RUN mkdir /data RUN [ "cross-build-end" ] VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage diff --git a/docker/arm32v7/Dockerfile.alpine b/docker/arm32v7/Dockerfile.alpine index 61376b8b..bcc636aa 100644 --- a/docker/arm32v7/Dockerfile.alpine +++ b/docker/arm32v7/Dockerfile.alpine @@ -67,8 +67,10 @@ RUN musl-strip target/armv7-unknown-linux-musleabihf/release/bitwarden_rs # because we already have a binary built FROM cmosh/alpine-arm:3.6 +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 ENV SSL_CERT_DIR=/etc/ssl/certs @@ -86,8 +88,8 @@ RUN mkdir /data RUN [ "cross-build-end" ] VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile index d8178504..71a6a560 100644 --- a/docker/arm64v8/Dockerfile +++ b/docker/arm64v8/Dockerfile @@ -87,8 +87,10 @@ RUN cargo build --features ${DB} --release --target=aarch64-unknown-linux-gnu # because we already have a binary built FROM balenalib/aarch64-debian:buster +ARG ROCKET_PORT=80 +ARG WEBSOCKET_PORT=3012 ENV ROCKET_ENV "staging" -ENV ROCKET_PORT=80 +ENV ROCKET_PORT=$ROCKET_PORT ENV ROCKET_WORKERS=10 RUN [ "cross-build-start" ] @@ -107,8 +109,8 @@ RUN mkdir /data RUN [ "cross-build-end" ] VOLUME /data -EXPOSE 80 -EXPOSE 3012 +EXPOSE $ROCKET_PORT +EXPOSE $WEBSOCKET_PORT # Copies the files from the context (Rocket.toml file and web-vault) # and the binary from the "build" stage to the current stage