Postgres
Quepasa works smoothly with PostgreSQL as a backing database. Below is an example Docker Compose snippet that sets up Quepasa with a PostgreSQL container.
services:
web:
image: codefroglabs/quepasa-web
environment:
QUEPASA__DATABASE__ENABLED: "true"
QUEPASA__DATABASE__CONNECTIONSTRING: "Host=db;Port=5432;Database=Quepasa;Username=quepasa;Password=YOUR-DB-PASSWORD"
QUEPASA__DATABASE__ADOINVARIANT: "Npgsql"
QUEPASA__DEPLOYMENT__CLUSTERMODE: "2"
QUEPASA__CLIENT__PRIMARYBACKEND: "http://backend"
ports:
- "5007:8080"
depends_on:
- backend
- db
backend:
image: codefroglabs/quepasa-backend
environment:
QUEPASA__DATABASE__ENABLED: "true"
QUEPASA__DATABASE__CONNECTIONSTRING: "Host=db;Port=5432;Database=Quepasa;Username=quepasa;Password=YOUR-DB-PASSWORD"
QUEPASA__DATABASE__ADOINVARIANT: "Npgsql"
QUEPASA__DEPLOYMENT__CLUSTERMODE: "2"
QUEPASA__SETUP__SEED: "true"
depends_on:
- db
db:
image: postgres
environment:
POSTGRES_USER: quepasa
POSTGRES_PASSWORD: YOUR-DB-PASSWORD
POSTGRES_DB: Quepasa
ports:
- "5432:5432"
Important Considerations
Enable the Database
QUEPASA__DATABASE__ENABLED=true
ensures Quepasa uses persistent storage.
Connection String
- A typical PostgreSQL connection string is something like:
Host=db;Port=5432;Database=Quepasa;Username=quepasa;Password=YOUR-DB-PASSWORD
- Here,
db
is the name of the PostgreSQL container service, and5432
is the standard PostgreSQL port.
- A typical PostgreSQL connection string is something like:
Environment Variables
QUEPASA__DATABASE__ADOINVARIANT=Npgsql
tells Quepasa to use PostgreSQL.POSTGRES_USER
andPOSTGRES_PASSWORD
define the database credentials.POSTGRES_DB
sets the default database name.
Production vs. Development
- In production, protect your passwords with a secret management tool. Consider persisting your database storage (e.g., using volumes) for data durability.
License Requirement
- When
QUEPASA__DATABASE__ENABLED=true
, Quepasa checks for a valid license on startup. Provide it viaQUEPASA_LICENSE
if required.
- When
With these configurations, Quepasa will store data in PostgreSQL. Remember to replace any placeholder passwords with your secure values.