commit 7d6f9d8970b2effd9e5ff8065228378de5b446e7 Author: Domenik Bildhauer Date: Sat Aug 8 20:36:48 2026 +0200 Initial Joplin Web Docker setup diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e83dcc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,69 @@ +FROM jetpackio/devbox:latest AS builder + +USER root + +RUN apt-get update && \ + apt-get install -y \ + git \ + ca-certificates \ + curl \ + rsync \ + && rm -rf /var/lib/apt/lists/* + +# Nix Build-Gruppe anlegen +RUN groupadd -r nixbld || true && \ + for i in $(seq 1 10); do \ + useradd -r \ + -g nixbld \ + -G nixbld \ + -d /var/empty \ + -s /usr/sbin/nologin \ + nixbld$i || true; \ + done + +WORKDIR /src + +# Stabile Joplin-Version herunterladen +RUN git clone \ + --depth 1 \ + --branch v3.6.15 \ + https://github.com/laurent22/joplin.git . + +# Version kontrollieren +RUN git describe --tags --exact-match + +# Joplin Build-Umgebung vorbereiten +RUN devbox run -- yarn --version + +# Joplin-Abhängigkeiten installieren +# RUN devbox run -- yarn install +RUN devbox run -- sh -c 'yarn install || { \ + echo "===== YARN BUILD ERROR LOGS ====="; \ + find /tmp -type f -name build.log -print -exec cat {} \; 2>/dev/null; \ + exit 1; \ + }' + +# Web-App bauen +WORKDIR /src + +#RUN devbox run -- yarn web +RUN devbox run -- sh -c 'cd /src/packages/app-mobile && yarn web' + + +# -------------------------------------------------- +# Fertiges Web-Frontend +# -------------------------------------------------- + +FROM nginx:alpine + +RUN rm -f /etc/nginx/conf.d/default.conf + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +COPY --from=builder \ + /src/packages/app-mobile/web/dist/ \ + /usr/share/nginx/html/ + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5cc12bc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + joplin-web: + build: + context: . + dockerfile: Dockerfile + container_name: joplin-web + restart: unless-stopped + ports: + - "3000:80" + security_opt: + - no-new-privileges:true diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..0d65760 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,39 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + add_header Cross-Origin-Opener-Policy "same-origin" always; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Resource-Policy "same-origin" always; + + location / { + try_files $uri $uri/ /index.html; + } + + location = /service-worker.js { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + expires off; + } + + location ~* \.(wasm|js|mjs)$ { + types { + application/wasm wasm; + application/javascript js mjs; + } + + try_files $uri =404; + + add_header Cross-Origin-Opener-Policy "same-origin" always; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Resource-Policy "same-origin" always; + } + + location ~* \.(css|png|jpg|jpeg|gif|ico|svg|woff|woff2|webp)$ { + try_files $uri =404; + expires 7d; + add_header Cache-Control "public"; + } +}