1.8 KiB
1.8 KiB
Docker Setup for flog
This directory contains Docker configuration to run the flog finance/expense logger in a containerized environment.
Prerequisites
- Docker Engine (version 20.10+)
- Docker Compose (version 2.0+)
Quick Start
-
Build and start the container:
docker compose up --build -d -
Open your browser and navigate to:
http://localhost:3010 -
Stop the container:
docker compose down
Configuration
- The app runs on port
3010by default (both inside the container and exposed to host). config.jsonis copied into the image at build time. If you need to change the port or validator string, updateconfig.jsonand rebuild.- User data is persisted in the
./datadirectory on the host (bind-mounted to/app/datain the container). This directory contains user wallets and shared keys.
Docker Image
The Dockerfile uses a multi-stage build:
- deps: Installs dependencies with
npm ci - build: Builds both client (
react-scripts build) and server (tsc -p tsconfig.server.json), then prunes dev dependencies - runtime: Copies built artifacts (
dist/,build/),config.json,index.js, and production dependencies
Notes
- The server serves the built React client from
build/and mounts the API at/api. - The container runs as root to ensure write access to the bind-mounted
./datadirectory. If you prefer a non-root user, uncomment theUSER nodedirective in the Dockerfile (note that the mounted./datadirectory must be owned by UID 1000). - Pre-existing
build/anddist/directories in the repo are not used when building the image — the image builds them fresh from source. - The build sets
CI=falseso CRA warnings don't cause build failures.