đŗ Quick Start â Docker¶
Run backend-antiginx in a container without a local Go setup.
â Requirements¶
- Docker 24+
- Internet access (to pull the image from GHCR)
- Reachable PostgreSQL and RabbitMQ instances
- Prepared environment values:
DATABASE_URL,RABBITMQ_URL,JWT_SECRET
Option A: Pre-built Image from GHCR¶
Pull the image¶
Run the container¶
docker run -d \
--name antiginx-backend \
-p 4000:4000 \
-e DATABASE_URL="postgres://user:pass@host:5432/antiginx" \
-e RABBITMQ_URL="amqp://user:pass@host:5672/" \
-e JWT_SECRET="super-secret-key" \
ghcr.io/prawo-i-piesc/backend-antiginx:latest
Option B: Build Image Locally¶
Build the image¶
Run the container¶
docker run -d \
--name antiginx-backend-local \
-p 4000:4000 \
-e DATABASE_URL="postgres://user:pass@host:5432/antiginx" \
-e RABBITMQ_URL="amqp://user:pass@host:5672/" \
-e JWT_SECRET="super-secret-key" \
backend-antiginx:local
â Quick Validation¶
Check container status:
Check API health:
View logs:
đ Useful Diagnostic Commands¶
Check if image exists locally:
List all containers (running and stopped):
Inspect logs for a specific container:
âšī¸ Stop Container¶
Stop and remove container:
đ ī¸ Notes¶
- Backend listens on port
4000inside the container. - The image runs as non-root user (
appuser). - If port
4000is busy, change mapping (for example:-p 8080:4000).
đ§ Troubleshooting¶
- Cannot connect to PostgreSQL/RabbitMQ â Verify host, port, credentials, and network reachability from container.
- Auth endpoints return 500/401 â Ensure
JWT_SECRETis set and non-empty. - Using
localhostin URLs fails â If DB/MQ are outside this container, use reachable hostnames/IPs (on macOS oftenhost.docker.internal). - Container exits immediately â Check startup errors with
docker logs antiginx-backend.