From fa3463a6e38d5cb700f030169b857a9391dababb Mon Sep 17 00:00:00 2001 From: jeanGaston Date: Mon, 13 Apr 2026 10:34:45 +0200 Subject: [PATCH] feat: Dockerfile and docker-compose Dockerfile: node:20-alpine, exposes 3456, STORE_PATH=/app/data/store.json. docker-compose.yml: proxy service with ./data volume mount + inline comments showing how to wire GOCARDLESS_BASE_URL into an existing actual-server compose. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 20 ++++++++++++++++++ docker-compose.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..517e331 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM node:20-alpine + +WORKDIR /app + +# Install dependencies first (layer cache) +COPY package.json ./ +RUN npm install --omit=dev + +# Copy source +COPY src/ ./src/ + +# Data directory (override with a volume) +RUN mkdir -p /app/data + +EXPOSE 3456 + +ENV NODE_ENV=production +ENV STORE_PATH=/app/data/store.json + +CMD ["node", "src/server.js"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9b25237 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,51 @@ +# docker-compose.yml +# +# Standalone: run just the proxy +# docker compose up +# +# With actual-server: paste the `gocardless-proxy` service block into your +# existing actual-server compose file and add GOCARDLESS_BASE_URL to actual-server. +# +# Run one-time setup BEFORE starting the proxy: +# docker compose run --rm gocardless-proxy node src/setup.js + +services: + gocardless-proxy: + build: . + # or use a pre-built image: + # image: ghcr.io/yourname/actual-gocardless-proxy:latest + container_name: gocardless-proxy + restart: unless-stopped + ports: + - "3456:3456" + volumes: + # Persist credentials, tokens, requisitions, and account mappings across restarts + - ./data:/app/data + environment: + PORT: 3456 + STORE_PATH: /app/data/store.json + # Set PROXY_BASE_URL to the URL that Enable Banking will redirect to after OAuth. + # Must be reachable by the user's browser. + # Examples: + # http://localhost:3456 (local dev, browser on same machine) + # https://yourserver.example.com (reverse-proxied, production) + # This can also be set during `npm run setup`. + # PROXY_BASE_URL: http://localhost:3456 + +# ───────────────────────────────────────────────────────────────────────────── +# How to wire this into your existing actual-server compose file: +# ───────────────────────────────────────────────────────────────────────────── +# +# 1. Add the gocardless-proxy service above to your docker-compose.yml +# 2. Add GOCARDLESS_BASE_URL to actual-server's environment: +# +# actual-server: +# image: actualbudget/actual-server:latest +# environment: +# GOCARDLESS_BASE_URL: http://gocardless-proxy:3456 +# # ... your other env vars +# depends_on: +# - gocardless-proxy +# +# 3. Make sure both services are on the same Docker network (they will be +# automatically if they're in the same compose file).