-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unleash compose file for podman and sql init script
- Loading branch information
1 parent
12a5982
commit 2fbbc1c
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- | ||
ALTER user unleash_user superuser | ||
createdb | ||
createrole; | ||
CREATE DATABASE unleash; | ||
GRANT ALL PRIVILEGES ON DATABASE unleash to unleash_user; | ||
GRANT ALL ON SCHEMA public to unleash_user; | ||
GRANT ALL ON ALL TABLES IN SCHEMA public to unleash_user; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
version: "3.9" | ||
services: | ||
|
||
# The Unleash server contains the Unleash configuration and | ||
# communicates with server-side SDKs and the Unleash Proxy | ||
unleash_web: | ||
image: quay.io/cloudservices/unleash-server:latest | ||
ports: | ||
- "4242:4242" | ||
environment: | ||
DATABASE_URL: "postgres://unleash_user:password@db/unleash" | ||
DATABASE_SSL: "false" | ||
LOG_LEVEL: "debug" | ||
INIT_FRONTEND_API_TOKENS: "default:development.unleash-insecure-frontend-api-token" | ||
INIT_CLIENT_API_TOKENS: "default:development.unleash-insecure-api-token" | ||
# This is setup to seed in feature flags, production is entirely different | ||
INIT_ADMIN_API_TOKENS: "*:*.unleash-insecure-api-token" | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
# Healthchecks aren't honored by compose anymore in depends_on | ||
healthcheck: | ||
test: wget --no-verbose --tries=1 --spider http://db:4242/health || exit 1 | ||
interval: 1s | ||
timeout: 1m | ||
retries: 5 | ||
start_period: 15s | ||
# Contains hard-coded sleep to wait for postgres to be ready | ||
command: [ "sh", "-c", "echo sleeping; sleep 30; node index.js"] | ||
|
||
# Note: Not all log data appears on the terminal output | ||
# To view more detailed log data, shell into the container and view like this: | ||
# cat var/lib/pgsql/data/userdata/log/postgresql-Tue.log | ||
db: | ||
expose: | ||
- "5432" | ||
ports: | ||
- "5432:5432" | ||
image: quay.io/sclorg/postgresql-15-c9s:latest | ||
environment: | ||
- POSTGRESQL_DATABASE=unleash | ||
- POSTGRESQL_USER=unleash_user | ||
- POSTGRESQL_PASSWORD=password | ||
healthcheck: | ||
test: ["CMD", "pg_isready", "--username=unleash_user", "--host=db", "--port=5432"] | ||
interval: 2s | ||
timeout: 1m | ||
retries: 5 | ||
start_period: 10s | ||
# This sets up the permissions for chrome user explicitly | ||
volumes: | ||
- ./postgres/data:/var/lib/postgresql/data | ||
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql |