mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 15:41:20 +02:00
- Added support for build arguments in Dockerfile to specify UID, GID, version, build time, and commit hash. - Updated docker-compose.yaml to utilize UID and GID for non-root user execution, improving file permission handling. - Introduced entrypoint.sh script to manage user permissions and environment setup at container startup. - Enhanced application logging to include version information during startup. - Updated README with new instructions for running the application with specific user IDs and environment variables.
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
services:
|
|
gomft:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
# Set the UID/GID to match your host user for better file permissions
|
|
# Default is 1000:1000 if not specified
|
|
UID: ${UID:-1000}
|
|
GID: ${GID:-1000}
|
|
# Version information
|
|
VERSION: ${VERSION:-dev}
|
|
BUILD_TIME: ${BUILD_TIME:-unknown}
|
|
COMMIT: ${COMMIT:-unknown}
|
|
container_name: gomft
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
# Main data directory - contains DB and configs
|
|
- gomft-data:/app/data
|
|
# Separate backups directory
|
|
- gomft-backups:/app/backups
|
|
# For development, you can mount the source code
|
|
# - .:/app
|
|
environment:
|
|
- TZ=UTC
|
|
- DATA_DIR=/app/data
|
|
- BACKUP_DIR=/app/backups
|
|
- LOGS_DIR=/app/data/logs
|
|
# - LOG_LEVEL=info
|
|
networks:
|
|
- gomft-network
|
|
# For non-root installs, the container needs to run with the same UID
|
|
# as the host user to access mounted volumes properly
|
|
user: ${UID:-1000}:${GID:-1000}
|
|
|
|
networks:
|
|
gomft-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
gomft-data:
|
|
driver: local
|
|
gomft-backups:
|
|
driver: local |