Configuration

Last updated


This page lists the environment variables the Go service reads, the storage directory layout, and the Docker Compose defaults.

Environment Variables


VariableDefaultRead byDescription
GO_ENV—configs.ModeDev()development enables development mode
PORT8080configs.GetPort()Go service listen port
DOMAIN—configs.GetDomain()Outside development mode, upload response src uses https://{DOMAIN}

GetDomain() affects only the src in upload responses, not routing or caching.

Docker Compose Defaults


docker-compose.yaml sets GO_ENV: development and DOMAIN: "joball.tw" on the golang service. Because GO_ENV is development, DOMAIN has no effect and upload responses return src as http://localhost:8080/.... In production, remove GO_ENV and set DOMAIN to the real public domain.

Storage Layout


All paths resolve against the working directory (os.Getwd()):
PathFunctionPurpose
storage/image/upload/GetUploadPath()Original uploads
storage/image/cache/GetCachePath()Transform cache, mirroring upload/
storage/image/upload/.trash/GetTrashPath()Trash, bucketed by date
internal/assets/image/404-{light,dark}.svgGet404SVG()Placeholder for failed reads

Docker Compose mounts the host's ./image to storage/image in the container, so that one directory is all you need to back up or migrate.
中文