Dockerfile 1.56 KB
Newer Older
1 2
# FROM "bitwardenrs/server:1.9.1" as bitwarden
FROM "vividboarder/bitwarden_rs:mail-auth-over-insecure" as bitwarden
Ian Fijolek's avatar
Ian Fijolek committed
3
FROM "vividboarder/bitwarden_rs_ldap:alpine" as bitwarden_ldap
4

5 6 7
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617

ENV ROCKET_ENV "staging"
Felix Bartels's avatar
Felix Bartels committed
8
ENV ROCKET_PORT=3000
9
ENV ROCKET_WORKERS=10
m4rg4sh's avatar
m4rg4sh committed
10
ENV DATA_FOLDER=/app/data
Felix Bartels's avatar
Felix Bartels committed
11
ENV CONFIG_FILE=/app/data/config.json
12

13
ENV SIGNUPS_ALLOWED=false
Felix Bartels's avatar
Felix Bartels committed
14
ENV INVITATIONS_ALLOWED=true
15
ENV WEBSOCKET_ENABLED=true
16

17 18 19 20 21
RUN mkdir -p /app/data
VOLUME /app/data
EXPOSE 80
EXPOSE 3012

22 23 24 25
# 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
Felix Bartels's avatar
Felix Bartels committed
26
COPY apache.conf /etc/apache2/sites-enabled/bitwarden.conf
Johannes Zellner's avatar
Johannes Zellner committed
27
RUN a2enmod ldap authnz_ldap proxy proxy_http proxy_wstunnel rewrite
28

29 30
# Copies the files from the context (Rocket.toml file and web-vault)
# and the binary from the "build" stage to the current stage
31 32 33
COPY --from=bitwarden /web-vault /app/code/web-vault
COPY --from=bitwarden /bitwarden_rs /app/code/
COPY --from=bitwarden /Rocket.toml /app/code/
Ian Fijolek's avatar
Ian Fijolek committed
34
# Copy ldap sync utility
Ian Fijolek's avatar
Ian Fijolek committed
35 36
COPY --from=bitwarden_ldap /usr/local/bin/bitwarden_rs_ldap /app/code/
ENV RUST_BACKTRACE=1
37

38 39 40 41
# configure supervisor
ADD supervisor/ /etc/supervisor/conf.d/
RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf

Felix Bartels's avatar
Felix Bartels committed
42
WORKDIR /app/code
Felix Bartels's avatar
Felix Bartels committed
43
COPY start.sh /app/code/start.sh
44
COPY ldap_sync.sh /app/code/ldap_sync.sh
45
COPY ldap_config.template.toml /app/code/ldap_config.template.toml
46

47
CMD [ "/app/code/start.sh" ]