Repository navigation
Expand file tree
/
Copy pathContainerfile
More file actions
54 lines (47 loc) · 2.74 KB
/
Copy pathContainerfile
File metadata and controls
54 lines (47 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# --------------------------------------------------------------------------
# THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
#
# Source: Containerfile.j2
# --------------------------------------------------------------------------
ARG BASE_VERSION=15
FROM ghcr.io/daemonless/nginx-base:${BASE_VERSION}
ARG FREEBSD_ARCH=amd64
ARG PACKAGES="ca_root_nss"
ARG UPSTREAM_URL="https://api.github.com/repos/storytold/vectorcraft/releases/latest"
ARG UPSTREAM_JQ=".tag_name"
LABEL org.opencontainers.image.title="VectorCraft" \
org.opencontainers.image.description="Open-source, clean-room reimplementation of Adobe Illustrator in Rust, served as a WebAssembly web app on FreeBSD." \
org.opencontainers.image.source="https://github.com/daemonless/vectorcraft" \
org.opencontainers.image.url="https://getartcraft.com/apps/vectorcraft" \
org.opencontainers.image.documentation="https://github.com/storytold/vectorcraft" \
org.opencontainers.image.licenses="MIT OR Apache-2.0" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="Photos & Media" \
io.daemonless.port="80" \
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.base="nginx" \
io.daemonless.upstream-url="${UPSTREAM_URL}" \
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
io.daemonless.packages="${PACKAGES}"
# The web release is a static WebAssembly site (index.html + .js/.wasm), no server code.
# Some releases ship cargo build leftovers (.fingerprint, build, deps) and .br files nginx
# cannot serve; drop them. Precompress the rest so nginx gzip_static sends ~40% of the raw wasm.
RUN pkg update && pkg install -y ${PACKAGES} && \
VERSION=$(fetch -qo - "${UPSTREAM_URL}" | jq -r "${UPSTREAM_JQ}" | sed 's/^v//') && \
echo "Installing VectorCraft web ${VERSION}" && \
fetch -qo /tmp/vectorcraft-web.zip "https://github.com/storytold/vectorcraft/releases/download/v${VERSION}/vectorcraft-web-${VERSION}.zip" && \
unzip -q /tmp/vectorcraft-web.zip -d /tmp/vectorcraft-web && \
mkdir -p /usr/local/www/app /app && \
mv /tmp/vectorcraft-web/vectorcraft-web-${VERSION}/* /usr/local/www/app/ && \
rm -rf /tmp/vectorcraft-web /tmp/vectorcraft-web.zip && \
cd /usr/local/www/app && \
rm -rf _headers build deps examples incremental *.br *.gz && \
find /usr/local/www/app -type f \( -name '*.wasm' -o -name '*.js' -o -name '*.html' -o -name '*.ttf' -o -name '*.otf' \) -exec gzip -9 -k {} \; && \
echo "${VERSION}" > /app/version && chmod a+r /app/version && \
chown -R bsd:bsd /usr/local/www/app && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
COPY root/ /
RUN chmod +x /etc/cont-init.d/* 2>/dev/null || true
EXPOSE 80