The Galactic Tournament frontend ships with a production-ready multi-stageDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HectorDNC/galactic-tournament-front/llms.txt
Use this file to discover all available pages before exploring further.
Dockerfile. The build stage compiles the Angular application inside a Node container; the serve stage copies the static output into a lean Nginx image. The final image has no Node.js runtime and is suitable for any container platform.
How the Dockerfile works
Because Angular bakes environment variables into the JavaScript bundle at compile time, the backend API URL must be injected beforeng build runs — not at container start-up. The Dockerfile accepts a --build-arg API_URL=... argument and uses a sed command to rewrite src/app/environments/environment.ts in-place before executing the build.
The default
API_URL build arg is http://localhost:8080. Always pass an explicit --build-arg API_URL=... when building an image intended for staging or production deployments.Build and run
Build the Docker image
From the repository root, run one of the following commands.The build process installs dependencies via pnpm, rewrites the environment file, and compiles the Angular bundle. Expect the first build to take 2–4 minutes; subsequent builds are faster thanks to Docker layer caching on the
- Default (localhost backend)
- Custom API URL (recommended)
Builds using the fallback
API_URL=http://localhost:8080 embedded in the Dockerfile:pnpm install step.Run the container
Start a detached container that maps Nginx’s port 80 to your host’s port 4200:You can verify the container is running with:To tail the Nginx access and error logs in real time:
Verify the deployment
Open your browser to You should see
http://localhost:4200. The Galactic Tournament Overview dashboard should load and API calls should reach the URL you injected at build time.To confirm the Angular output was copied correctly, you can inspect the container’s file system:index.html and hashed JS/CSS asset files — the compiled output of dist/ng-tailadmin/browser.Docker Compose
For local development stacks or CI environments, adocker-compose.yml file lets you build and run the frontend with a single command.
docker-compose.yml
Useful Docker commands
| Command | Description |
|---|---|
docker build -t galactic-tournament-front . | Build the image with the default API URL |
docker build --build-arg API_URL=<url> -t galactic-tournament-front . | Build with a custom API URL |
docker run -d -p 4200:80 --name galactic-app galactic-tournament-front | Run the container in detached mode |
docker logs -f galactic-app | Stream container logs |
docker stop galactic-app | Stop the running container |
docker ps | List all running containers |
docker image ls | List locally available images |
docker rmi galactic-tournament-front | Remove the local image |
Common issues
403 Forbidden
Nginx returns a403 Forbidden error when it cannot read index.html due to file permission problems. The Dockerfile already addresses this by running:
COPY step precedes them.
Port already in use
If port4200 is occupied on your host, map the container to a different port:
http://localhost:4201 in your browser.
Wrong or missing output path
The Angular build outputs todist/ng-tailadmin/browser (the project name in package.json is ng-tailadmin). The COPY instruction in the serve stage targets this exact path:
SPA routes returning 404
The customnginx.conf includes an Angular SPA fallback that redirects all unmatched paths to index.html:
nginx.conf with a different configuration, ensure this try_files directive is present. Without it, navigating directly to routes such as /species or /battles will return a 404 Not Found from Nginx.