FROM cloudron/base:4.0.0@sha256:31b195ed0662bdb06a6e8a5ddbedb6f191ce92e8bee04c03fb02dd4e9d0286df RUN mkdir -p /app/code /app/pkg WORKDIR /app/code # The required rust version is installed by cargo during bitwarden build RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh \ && chmod +x rustup-init.sh \ && ./rustup-init.sh -y --profile minimal && \ rm rustup-init.sh ENV PATH /root/.cargo/bin:$PATH # Note that these two hand in hand. Wait for the backend to list the vault version ARG VAULTWARDEN_VERSION=1.29.2 # https://github.com/dani-garcia/bw_web_builds/releases/ ARG WEB_VAULT_VERSION=2023.7.1 RUN mkdir /src && \ curl -L "https://github.com/dani-garcia/bitwarden_rs/archive/${VAULTWARDEN_VERSION}.tar.gz" | tar zxf - --strip-components 1 -C /src && \ cd /src && \ cargo build --features mysql --release && \ mv /src/target/release/vaultwarden /app/code/vaultwarden && \ rm -rf /src RUN curl -L "https://github.com/dani-garcia/bw_web_builds/releases/download/v${WEB_VAULT_VERSION}/bw_web_v${WEB_VAULT_VERSION}.tar.gz" | tar zxf - # configure apache RUN rm /etc/apache2/sites-enabled/* RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf RUN a2disconf other-vhosts-access-log COPY apache/vaultwarden.conf /etc/apache2/sites-enabled/vaultwarden.conf RUN a2enmod proxy proxy_http proxy_wstunnel rewrite RUN echo "Listen 8000" > /etc/apache2/ports.conf # configure supervisor COPY supervisor/ /etc/supervisor/conf.d/ RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf COPY config.json.template start.sh /app/pkg/ CMD [ "/app/pkg/start.sh" ]