You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.7 KiB
65 lines
2.7 KiB
services: |
|
gitrepublic: |
|
# OPTION 1: Use pre-built image from registry (recommended for production) |
|
# Only requires: docker-compose.yml and ./repos directory |
|
# No Dockerfile or docker-entrypoint.sh needed on the server |
|
image: ${DOCKER_IMAGE:-silberengel/gitrepublic-web:latest} |
|
|
|
# OPTION 2: Build from source (uncomment below and comment out image above) |
|
# Requires: Dockerfile, docker-entrypoint.sh, and source code |
|
# build: |
|
# context: . |
|
# dockerfile: Dockerfile |
|
container_name: gitrepublic-web |
|
# Publish port to host (required when reverse proxy is on host, not in Docker) |
|
# Apache on host machine proxies to 127.0.0.1:6543, so we need ports: not expose: |
|
ports: |
|
- "${PORT:-6543}:6543" |
|
# Alternative: If reverse proxy is in Docker (same network), use expose instead: |
|
# expose: |
|
# - "6543" # Internal only, accessed via reverse proxy container |
|
environment: |
|
- NODE_ENV=production |
|
# ENTERPRISE_MODE: Not set (defaults to false) - this is lightweight mode |
|
# For enterprise mode with Kubernetes, see k8s/ENTERPRISE_MODE.md |
|
- GIT_REPO_ROOT=/repos |
|
- GIT_DOMAIN=${GIT_DOMAIN:-gitrepublic.imwald.eu} # Set to your domain for production (without https://) |
|
- NOSTR_RELAYS=${NOSTR_RELAYS:-wss://theforest.nostr1.com} |
|
- NOSTRGIT_SECRET_KEY=${NOSTRGIT_SECRET_KEY:-} |
|
- PORT=6543 |
|
volumes: |
|
# Persist git repositories |
|
# The entrypoint script will automatically fix permissions on startup |
|
# No manual chown needed - works out of the box! |
|
- ./repos:/repos |
|
# Optional: persist audit logs |
|
# - ./logs:/app/logs |
|
# Optional: mount config file if needed |
|
# - ./config:/app/config:ro |
|
# Optional: Override UID/GID via environment variables if needed |
|
# Default is 10000:10000 (standardized, avoids conflicts) |
|
# Uncomment and adjust if you need to match a specific host user: |
|
# environment: |
|
# - GITREPUBLIC_UID=1001 |
|
# - GITREPUBLIC_GID=1001 |
|
restart: unless-stopped |
|
healthcheck: |
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:6543', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)}).on('error', () => {process.exit(1)})"] |
|
interval: 30s |
|
timeout: 5s |
|
retries: 3 |
|
start_period: 10s |
|
# Resource limits (adjust as needed) |
|
# Note: deploy section is for Docker Swarm only |
|
# For local development with docker-compose v1, use: |
|
# mem_limit: 2g |
|
# cpus: '2' |
|
# For docker-compose v2 or Docker Swarm, uncomment below: |
|
# deploy: |
|
# resources: |
|
# limits: |
|
# cpus: '2' |
|
# memory: 2G |
|
# reservations: |
|
# cpus: '1' |
|
# memory: 1G
|
|
|