From 39c2cd3806977d14239d2e84bd8793c00533a93d Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 12 Oct 2022 14:31:18 -0400 Subject: [PATCH] Add standardnotes-web --- standardnotes-web/Dockerfile | 22 ++++++++++++++++++++++ standardnotes-web/start.sh | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 standardnotes-web/Dockerfile create mode 100644 standardnotes-web/start.sh diff --git a/standardnotes-web/Dockerfile b/standardnotes-web/Dockerfile new file mode 100644 index 0000000..9d2e39e --- /dev/null +++ b/standardnotes-web/Dockerfile @@ -0,0 +1,22 @@ +FROM node:16-alpine AS builder + +ARG SN_TAG=@standardnotes/web@3.72.4 + +RUN apk add git + +RUN git clone --depth=1 https://github.com/standardnotes/app -b ${SN_TAG} + +RUN cd app && yarn install && yarn build:web + +FROM joseluisq/static-web-server:2-alpine + +ENV SN_WEB_PUBLIC_URL=https://app.standardnotes.com +ENV SN_WEB_DEFAULT_SYNC_SERVER=https://api.standardnotes.com +ENV SN_WEB_DEFAULT_FILES_HOST=https://files.standardnotes.com + +COPY --from=builder /app/packages/web/dist /public +COPY start.sh / + +RUN chmod +x /start.sh + +CMD [ "/start.sh" ] diff --git a/standardnotes-web/start.sh b/standardnotes-web/start.sh new file mode 100644 index 0000000..dbb894e --- /dev/null +++ b/standardnotes-web/start.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +sed -i "s@https://app.standardnotes.com@${SN_WEB_PUBLIC_URL}@g" /public/index.html +sed -i "s@https://api.standardnotes.com@${SN_WEB_DEFAULT_SYNC_SERVER}@g" /public/index.html +sed -i "s@https://files.standardnotes.com@${SN_WEB_DEFAULT_FILES_HOST}@g" /public/index.html + +exec static-web-server