1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

add docker build for admin

This commit is contained in:
Kyle Spearrin 2018-03-23 21:11:17 -04:00
parent f07cb3ab07
commit 24b8619bd1
9 changed files with 67 additions and 0 deletions

View File

@ -10,5 +10,6 @@ echo "=================="
& $dir\util\Nginx\build.ps1
& $dir\util\Attachments\build.ps1
& $dir\src\Icons\build.ps1
& $dir\src\Admin\build.ps1
& $dir\util\MsSql\build.ps1
& $dir\util\Setup\build.ps1

View File

@ -17,6 +17,7 @@ then
docker push bitwarden/server:$TAG
docker push bitwarden/attachments:$TAG
docker push bitwarden/icons:$TAG
docker push bitwarden/admin:$TAG
docker push bitwarden/nginx:$TAG
docker push bitwarden/mssql:$TAG
docker push bitwarden/setup:$TAG
@ -31,6 +32,7 @@ then
docker tag bitwarden/server bitwarden/server:$TAG
docker tag bitwarden/attachments bitwarden/attachments:$TAG
docker tag bitwarden/icons bitwarden/icons:$TAG
docker tag bitwarden/admin bitwarden/admin:$TAG
docker tag bitwarden/nginx bitwarden/nginx:$TAG
docker tag bitwarden/mssql bitwarden/mssql:$TAG
docker tag bitwarden/setup bitwarden/setup:$TAG
@ -56,6 +58,9 @@ else
chmod u+x $DIR/src/Icons/build.sh
$DIR/src/Icons/build.sh
chmod u+x $DIR/src/Admin/build.sh
$DIR/src/Admin/build.sh
chmod u+x $DIR/util/MsSql/build.sh
$DIR/util/MsSql/build.sh

4
src/Admin/.dockerignore Normal file
View File

@ -0,0 +1,4 @@
*
!obj/Docker/publish/*
!obj/Docker/empty/
!entrypoint.sh

9
src/Admin/Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM microsoft/aspnetcore:2.0.5
WORKDIR /app
EXPOSE 80
COPY obj/Docker/publish .
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

14
src/Admin/build.ps1 Normal file
View File

@ -0,0 +1,14 @@
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
echo "`n## Building Admin"
echo "`nBuilding app"
echo ".NET Core version $(dotnet --version)"
echo "Clean"
dotnet clean $dir\Admin.csproj -f netcoreapp2.0 -c "Release" -o $dir\obj\Docker\publish
echo "Publish"
dotnet publish $dir\Admin.csproj -f netcoreapp2.0 -c "Release" -o $dir\obj\Docker\publish
echo "`nBuilding docker image"
docker --version
docker build -t bitwarden/admin $dir\.

17
src/Admin/build.sh Normal file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo -e "\n## Building Admin"
echo -e "\nBuilding app"
echo ".NET Core version $(dotnet --version)"
echo "Clean"
dotnet clean $DIR/Admin.csproj -f netcoreapp2.0 -c "Release" -o $DIR/obj/Docker/publish
echo "Publish"
dotnet publish $DIR/Admin.csproj -f netcoreapp2.0 -c "Release" -o $DIR/obj/Docker/publish
echo -e "\nBuilding docker image"
docker --version
docker build -t bitwarden/admin $DIR/.

3
src/Admin/entrypoint.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
dotnet /app/Admin.dll

View File

@ -145,6 +145,16 @@ services:
- global.env
- ../env/global.override.env
admin:
image: bitwarden/admin:{CoreVersion}
container_name: bitwarden-admin
restart: always
volumes:
- ../core:/etc/bitwarden/core
env_file:
- global.env
- ../env/global.override.env
icons:
image: bitwarden/icons:{CoreVersion}
container_name: bitwarden-icons

View File

@ -193,6 +193,10 @@ server {{
location /icons/ {{
proxy_pass http://icons/;
}}
location /admin/ {{
proxy_pass http://admin/;
}}
}}");
}
}