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 <noreply@anthropic.com>
This commit is contained in:
jeanGaston 2026-04-13 10:34:45 +02:00
parent b4f174dcff
commit fa3463a6e3
2 changed files with 71 additions and 0 deletions

20
Dockerfile Normal file
View File

@ -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"]

51
docker-compose.yml Normal file
View File

@ -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).