1
0
mirror of https://github.com/bitwarden/web synced 2026-01-08 19:44:08 +00:00

More work on the decoupling. It is not currently in a working state

This commit is contained in:
Joseph Flinn
2022-01-28 22:41:45 +00:00
parent 9d393224da
commit f244f4ffde
5 changed files with 40 additions and 29 deletions

View File

@@ -1,3 +1,4 @@
*
!docker/*
!build/*
!entrypoint.sh

36
Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
FROM nginx:stable
LABEL com.bitwarden.product="bitwarden"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY docker/nginx.conf /etc/nginx
COPY docker/nginx-web.conf /etc/nginx
COPY docker/mime.types /etc/nginx
COPY docker/security-headers.conf /etc/nginx
WORKDIR /app
COPY ./build .
COPY docker/entrypoint.sh /
RUN chmod +x /entrypoint.sh
RUN bash /entrypoint.sh
RUN chown -R bitwarden:bitwarden /app && chmod -R 755 /app && \
chown -R bitwarden:bitwarden /var/cache/nginx && \
chown -R bitwarden:bitwarden /var/log/nginx && \
chown -R bitwarden:bitwarden /etc/nginx/conf.d
RUN touch /var/run/nginx.pid && \
chown -R bitwarden:bitwarden /var/run/nginx.pid
USER bitwarden
EXPOSE 8080
HEALTHCHECK CMD curl -f http://localhost:8080 || exit 1
#ENTRYPOINT ["/entrypoint.sh"]
#CMD ["tail", "-f", "/dev/null"]
CMD nginx -g 'daemon off;'

View File

@@ -1,24 +0,0 @@
FROM nginx:stable
LABEL com.bitwarden.product="bitwarden"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY nginx.conf /etc/nginx
COPY nginx-web.conf /etc/nginx
COPY mime.types /etc/nginx
COPY security-headers.conf /etc/nginx
WORKDIR /app
EXPOSE 80
COPY ./build .
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
HEALTHCHECK CMD curl -f http://localhost:80 || exit 1
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -32,6 +32,6 @@ mkhomedir_helper $USERNAME
chown -R $USERNAME:$GROUPNAME /etc/bitwarden
cp /etc/bitwarden/web/app-id.json /app/app-id.json
chown -R $USERNAME:$GROUPNAME /app
chown -R $USERNAME:$GROUPNAME /bitwarden_server
#chown -R $USERNAME:$GROUPNAME /bitwarden_server
exec nginx -g daemon off;
#exec nginx -g 'daemon off;'

View File

@@ -27,11 +27,9 @@ events {
# Default error log file
# (this is only used when you don't override error_log on a server{} level)
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx/nginx.pid;
pid /var/run/nginx.pid;
http {
include proxy.conf;
# Hide nginx version information.
server_tokens off;