Use PORT instead of UPAAS_PORT for listen port

This commit is contained in:
Jeffrey Paul 2025-12-29 16:15:05 +07:00
parent 0f2df60c58
commit 219a561473
4 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,6 @@ COPY --from=builder /src/bin/upaasd /app/upaasd
RUN mkdir -p /var/lib/upaas
ENV UPAAS_DATA_DIR=/var/lib/upaas
ENV UPAAS_PORT=8080
EXPOSE 8080

View File

@ -156,7 +156,7 @@ Environment variables:
| Variable | Description | Default |
|----------|-------------|---------|
| `UPAAS_PORT` | HTTP listen port | 8080 |
| `PORT` | HTTP listen port | 8080 |
| `UPAAS_DATA_DIR` | Data directory for SQLite and keys | ./data |
| `UPAAS_DOCKER_HOST` | Docker socket path | unix:///var/run/docker.sock |
| `DEBUG` | Enable debug logging | false |

View File

@ -7,8 +7,7 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- upaas-data:/var/lib/upaas
environment:
- UPAAS_PORT=8080
# environment:
# Optional: uncomment to enable debug logging
# - DEBUG=true
# Optional: Sentry error reporting

View File

@ -89,6 +89,9 @@ func setupViper(name string) {
viper.AutomaticEnv()
// Defaults
// PORT is not prefixed with UPAAS_ for compatibility
_ = viper.BindEnv("PORT", "PORT")
viper.SetDefault("PORT", defaultPort)
viper.SetDefault("DEBUG", false)
viper.SetDefault("DATA_DIR", "./data")