From 9453490bca3a06fe4456c4502cf951fcafc0ee44 Mon Sep 17 00:00:00 2001 From: Aine Date: Sat, 18 Jan 2025 09:21:58 +0200 Subject: [PATCH] update docker instructions, fixes #278 --- .dockerignore | 1 + Dockerfile.build | 11 +++++++++++ README.md | 1 + docker-compose.yml | 2 ++ 4 files changed, 15 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile.build diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ace1063 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/testdata diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..d957460 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,11 @@ +FROM node:lts AS builder +ARG BASE_PATH=./ +WORKDIR /src +COPY . /src +RUN yarn config set enableTelemetry 0 && \ + yarn install --immutable --network-timeout=300000 && \ + yarn build --base=$BASE_PATH + +FROM ghcr.io/static-web-server/static-web-server:2 +ENV SERVER_ROOT=/app +COPY --from=builder /src/dist /app diff --git a/README.md b/README.md index b5779c8..6dfb92a 100644 --- a/README.md +++ b/README.md @@ -261,6 +261,7 @@ You have three options: hostname: synapse-admin build: context: https://github.com/etkecc/synapse-admin.git + dockerfile: Dockerfile.build args: - BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 # - NODE_OPTIONS="--max_old_space_size=1024" diff --git a/docker-compose.yml b/docker-compose.yml index 68c52ac..e4235b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,10 @@ services: container_name: synapse-admin hostname: synapse-admin image: ghcr.io/etkecc/synapse-admin:latest + dockerfile: Dockerfile.build # build: # context: . + # dockerfile: Dockerfile.build # to use the docker-compose as standalone without a local repo clone, # replace the context definition with this: