Skip to main content
Docker Compose is the fastest way to bring up a complete SmartLogix environment. A single docker compose up -d builds all service images and starts every container in the correct order, connected over a shared bridge network called smartlogix-net.
The JWT_SECRET value shipped in docker-compose.yml (bXlTZWN1cmVTZWNyZXRLZXkxMjM0NTY3ODkwQUJDREU=) is a well-known placeholder. Replace it with a securely generated Base64-encoded HMAC-SHA key before deploying to any non-local environment.

Prerequisites

  • Docker Desktop (macOS / Windows) or Docker Engine + the Docker Compose plugin (Linux)
  • Docker Compose v2 or later (docker compose version)
  • At least 4 GB of RAM available to Docker

Deployment steps

1

Clone the repository

git clone https://github.com/emiledubois/fullstack3.git
cd fullstack3
2

Set the JWT secret

The API gateway and auth-service share a single JWT_SECRET to sign and verify tokens. Both services must receive the same Base64-encoded value; a mismatch will cause every authenticated request to fail with 401.Generate a secret and export it before starting the stack:
# Generate a random 256-bit key and Base64-encode it
export JWT_SECRET=$(openssl rand -base64 32)
echo "JWT_SECRET=$JWT_SECRET" >> .env
Then update docker-compose.yml to reference the variable, or pass it inline on the next step.
If you are running locally for the first time and only want to validate the setup, you can skip this step. The placeholder secret already present in docker-compose.yml will be used automatically.
3

Build and start all services

docker compose up -d
Docker Compose builds every image (this takes a few minutes on the first run because Maven downloads dependencies) and starts all containers in dependency order.
4

Wait for services to become ready

The Spring Boot services take 20–40 seconds to start after the container is up. Poll the gateway health endpoint until it returns {"status":"UP"}:
watch -n 3 curl -s http://localhost:8080/actuator/health
Press Ctrl+C once the status is UP.
5

Verify all services

Hit the health or root endpoint for each service to confirm everything is running:
curl -s http://localhost:8080/actuator/health   # api-gateway
curl -s http://localhost:8081/actuator/health   # auth-service
curl -s http://localhost:8082/actuator/health   # ms-inventario
curl -s http://localhost:8083/actuator/health   # ms-pedidos
curl -s http://localhost:8084/actuator/health   # ms-envios
Open the frontend in your browser at http://localhost:5173.

Service access

ServiceHost portURL
API Gateway8080http://localhost:8080
Auth Service8081http://localhost:8081
Inventory Service8082http://localhost:8082
Orders Service8083http://localhost:8083
Shipping Service8084http://localhost:8084
Notification Service8085http://localhost:8085
Frontend (nginx)5173http://localhost:5173
All service-to-service communication happens internally over smartlogix-net. Only the ports listed above are exposed to your host machine.

Viewing logs

Stream logs for a specific service:
docker compose logs -f api-gateway
docker compose logs -f auth-service
docker compose logs -f ms-pedidos
Stream logs for all services at once:
docker compose logs -f

Stopping the stack

docker compose down
This stops and removes containers and the default network, but leaves named volumes intact so your data is preserved. To also remove volumes (wipes all database data):
docker compose down -v

Rebuilding after code changes

If you modify source code and want to pick up the changes:
docker compose up -d --build
Compose rebuilds only the images whose build context has changed, then restarts the affected containers.

Data persistence

Four named Docker volumes hold PostgreSQL data so it survives container restarts and docker compose down:
VolumeDatabase serviceDatabase name
auth-datapostgres-authauth_db
inventario-datapostgres-inventarioinventario_db
pedidos-datapostgres-pedidospedidos_db
envios-datapostgres-enviosenvios_db
List volumes:
docker volume ls | grep fullstack3