Skip to content

Commit

Permalink
New optimized Alpine 3.19 based build
Browse files Browse the repository at this point in the history
* Dockerfile refactor
* Version bump
* Code cleanup
  • Loading branch information
k0gen committed Apr 9, 2024
1 parent 5abe0ee commit e86f084
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
20 changes: 6 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
FROM vaultwarden/server:1.30.1
FROM vaultwarden/server:1.30.5-alpine

RUN apt update && \
apt install -y \
RUN apk update && \
apk add --no-cache \
tini \
argon2 \
nginx-core; \
apt clean; \
nginx \
yq; \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/cache/apk/* \
/var/tmp/*
RUN mkdir /run/nginx


# arm64 or amd64
ARG PLATFORM
ENV YQ_VER v4.3.2
RUN curl -L https://github.com/mikefarah/yq/releases/download/${YQ_VER}/yq_linux_${PLATFORM} -o /usr/local/bin/yq \
&& chmod a+x /usr/local/bin/yq

COPY --chmod=755 ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
7 changes: 2 additions & 5 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
ADMIN_TOKEN=$(yq e '.admin-token' /data/start9/config.yaml)
VW_ADMIN_TOKEN=$(echo -n "$ADMIN_TOKEN" | argon2 "$(openssl rand -base64 32)" -e -id -k 65540 -t 3 -p 4)
echo "ADMIN_TOKEN='${VW_ADMIN_TOKEN}'" >> /.env
#Ensure config.json's admin token gets upgraded if the old token exists in config.json:
sed -i "s|$ADMIN_TOKEN|$VW_ADMIN_TOKEN|g" /data/config.json

TOR_ADDRESS=$(yq e .vaultwarden-tor-address /data/start9/config.yaml)
LAN_ADDRESS=$(yq e .vaultwarden-lan-address /data/start9/config.yaml)
Expand Down Expand Up @@ -39,7 +37,7 @@ data:
masked: false
EOF

CONF_FILE="/etc/nginx/conf.d/default.conf"
CONF_FILE="/etc/nginx/http.d/default.conf"
NGINX_CONF='
server {
##
Expand Down Expand Up @@ -100,9 +98,8 @@ server {
}
}
'
rm /etc/nginx/sites-enabled/default
echo "$NGINX_CONF" > $CONF_FILE
sed -i "s/TLSv1 TLSv1.1 //" /etc/nginx/nginx.conf
sed -i "s#ssl_protocols TLSv1.1#ssl_protocols#g" /etc/nginx/nginx.conf

nginx -g 'daemon off;' &
exec tini -p SIGTERM -- /start.sh
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "vaultwarden",
"title": "Vaultwarden",
"version": "1.30.1",
"release-notes": "* This is a minor release to fix some issues with the Login with device feature\n* Full list of upstream changes available [here](https://github.com/dani-garcia/vaultwarden/compare/1.30.0...1.30.1)",
"version": "1.30.5",
"release-notes": "* New optimized Alpine 3.19 based build image, achieving approximately 67% decrease in package size!\n * Fixed attachment upload size check\n* Updated web-vault to v2024.1.2b\n* Full list of upstream changes available [here](https://github.com/dani-garcia/vaultwarden/compare/1.30.1...1.30.5)",
"license": "AGPLv3",
"wrapper-repo": "https://github.com/Start9Labs/vaultwarden-startos",
"upstream-repo": "https://github.com/dani-garcia/vaultwarden",
Expand Down
2 changes: 1 addition & 1 deletion scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { manifest } from "../generated/manifest.ts";

export const migration: T.ExpectedExports.migration = migrations.fromMapping(
{
// 1.30.1 No migration needed
// 1.30.5 No migration needed
},
manifest.version,
);

0 comments on commit e86f084

Please sign in to comment.