Skip to content

đŸŗ 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

docker pull ghcr.io/prawo-i-piesc/backend-antiginx:latest

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

docker build -t backend-antiginx:local .

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:

docker ps

Check API health:

curl http://localhost:4000/api/health

View logs:

docker logs -f antiginx-backend


🔍 Useful Diagnostic Commands

Check if image exists locally:

docker images | grep backend-antiginx

List all containers (running and stopped):

docker ps -a

Inspect logs for a specific container:

docker logs <container_id>


âšī¸ Stop Container

Stop and remove container:

docker stop antiginx-backend && docker rm antiginx-backend


đŸ› ī¸ Notes

  • Backend listens on port 4000 inside the container.
  • The image runs as non-root user (appuser).
  • If port 4000 is 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_SECRET is set and non-empty.
  • Using localhost in URLs fails → If DB/MQ are outside this container, use reachable hostnames/IPs (on macOS often host.docker.internal).
  • Container exits immediately → Check startup errors with docker logs antiginx-backend.