entrypoint not working
This commit is contained in:
parent
264f7e6f21
commit
9385e45c8e
1
abra.sh
1
abra.sh
|
@ -1 +1,2 @@
|
||||||
export NGINX_CONFIG_VERSION=v1
|
export NGINX_CONFIG_VERSION=v1
|
||||||
|
export POSTGRES_ENTRYPOINT_VERSION=v1
|
||||||
|
|
35
compose.yml
35
compose.yml
|
@ -37,7 +37,7 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- db
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
- "shiv_data:/root/.shiv"
|
- "shiv_data:/root/.shiv"
|
||||||
|
@ -90,7 +90,7 @@ services:
|
||||||
- LISTEN_HOST=0.0.0.0
|
- LISTEN_HOST=0.0.0.0
|
||||||
- LISTEN_SERVER=uvicorn
|
- LISTEN_SERVER=uvicorn
|
||||||
- SECRET_KEY=foobar
|
- SECRET_KEY=foobar
|
||||||
- DATABASE_HOST=postgres
|
- DATABASE_HOST=db
|
||||||
- DATABASE_PORT=5432
|
- DATABASE_PORT=5432
|
||||||
- DATABASE_NAME=karrot
|
- DATABASE_NAME=karrot
|
||||||
- DATABASE_USER=karrot
|
- DATABASE_USER=karrot
|
||||||
|
@ -116,13 +116,18 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
|
||||||
postgres:
|
db:
|
||||||
image: "postgres:14-alpine"
|
image: "postgres:14-alpine"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U karrot"]
|
test: ["CMD-SHELL", "pg_isready -U karrot"]
|
||||||
interval: 1s
|
interval: 1s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 30
|
retries: 30
|
||||||
|
configs:
|
||||||
|
- source: postgres_entrypoint
|
||||||
|
target: /coopcloud-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint: /coopcloud-entrypoint.sh
|
||||||
volumes:
|
volumes:
|
||||||
- "postgres_data:/var/lib/postgresql/data"
|
- "postgres_data:/var/lib/postgresql/data"
|
||||||
networks:
|
networks:
|
||||||
|
@ -131,7 +136,22 @@ services:
|
||||||
- POSTGRES_PASSWORD=karrot
|
- POSTGRES_PASSWORD=karrot
|
||||||
- POSTGRES_USER=karrot
|
- POSTGRES_USER=karrot
|
||||||
- POSTGRES_DB=karrot
|
- POSTGRES_DB=karrot
|
||||||
|
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
db_password:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
||||||
|
|
||||||
|
configs:
|
||||||
|
nginx_config:
|
||||||
|
name: ${STACK_NAME}_nginx_config_${NGINX_CONFIG_VERSION}
|
||||||
|
file: nginx.conf.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
postgres_entrypoint:
|
||||||
|
name: ${STACK_NAME}_postgres_entrypoint_${POSTGRES_ENTRYPOINT_VERSION}
|
||||||
|
file: pg_entrypoint.sh
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
shiv_data:
|
shiv_data:
|
||||||
geoip_data:
|
geoip_data:
|
||||||
|
@ -142,10 +162,3 @@ networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
internal:
|
internal:
|
||||||
|
|
||||||
|
|
||||||
configs:
|
|
||||||
nginx_config:
|
|
||||||
name: ${STACK_NAME}_nginx_config_${NGINX_CONFIG_VERSION}
|
|
||||||
file: nginx.conf.tmpl
|
|
||||||
template_driver: golang
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This is based on https://github.com/postgis/docker-postgis/blob/4eb614133d6aa87bfc5c952d24b7eb1f499e5c7c/12-3.0/initdb-postgis.sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Perform all actions as $POSTGRES_USER
|
||||||
|
export PGUSER="$POSTGRES_USER"
|
||||||
|
|
||||||
|
for DB in template1 "$POSTGRES_DB"; do
|
||||||
|
echo "Loading extensions into $DB"
|
||||||
|
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
|
||||||
|
CREATE EXTENSION IF NOT EXISTS citext;
|
||||||
|
CREATE EXTENSION IF NOT EXISTS btree_gist;
|
||||||
|
EOSQL
|
||||||
|
done
|
||||||
|
|
||||||
|
/docker-entrypoint.sh "$@"
|
Loading…
Reference in New Issue