Overview
This guide walks you through setting up and customizing the ExampleApp platform. Follow the steps to get a production‑ready configuration.
Prerequisites
- Node.js ≥ 18.x
- Docker Engine ≥ 20.10
- Access to a PostgreSQL instance
- Administrator privileges on the target machine
Installation
Run the following commands to pull the Docker image and start the container:
docker pull example/app:latest
docker run -d \
-e DATABASE_URL=postgres://user:pass@host:5432/dbname \
-p 8080:80 \
--name example-app \
example/app:latest
Verify the container is up:
docker ps -f name=example-app
Configuration Files
app-config.yaml
Primary configuration file located at /etc/example/app-config.yaml.
server:
host: 0.0.0.0
port: 80
database:
url: ${DATABASE_URL}
poolSize: 20
logging:
level: info
format: json
logging.json
JSON log schema used by the internal logger.
{
"timestamp":"2024-01-01T12:00:00Z",
"level":"info",
"message":"Service started",
"service":"example-app"
}
Advanced Options
Enable optional modules by adding them to modules.enabled:
modules:
enabled:
- cache
- metrics
- auth
For TLS termination, mount your certificates and set the following:
tls:
enabled: true
certFile: /certs/tls.crt
keyFile: /certs/tls.key
Troubleshooting
Container fails to start
Check logs with:
docker logs example-app
Database connection errors
Ensure DATABASE_URL is correctly formatted and reachable from the container.
FAQ
- Can I change the default port? Yes, edit the
server.portfield inapp-config.yaml. - How do I update the image? Pull the latest tag and restart the container:
docker pull example/app:latest
docker stop example-app && docker rm example-app
docker run ... (same command as installation)