extracted from infraRasp repository
This commit is contained in:
parent
20e53d12af
commit
1f73f67270
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM postgres:14.1-bullseye
|
||||
|
||||
COPY initScript/*.sh /docker-entrypoint-initdb.d/
|
||||
RUN localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8
|
||||
ENV LANG fr_FR.utf8
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
VOLUME /var/lib/postgresql/data/instance
|
||||
|
||||
EXPOSE 5432
|
||||
CMD ["postgres"]
|
20
Makefile
Normal file
20
Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
.PHONY: imagePostgres
|
||||
|
||||
REGISTRY_IP=docker.registry
|
||||
# linux/arm/v7
|
||||
# linux/arm/v6
|
||||
# linux/arm64
|
||||
# linux/amd64
|
||||
PLATFORM=linux/arm/v6
|
||||
#VERBOSITY=info
|
||||
VERBOSITY=debug
|
||||
|
||||
## build
|
||||
|
||||
imagePostgres:
|
||||
$(shell docker-multi-arch-builder build -n postgres --platforms $(PLATFORM) -v $(VERBOSITY))
|
||||
|
||||
## management
|
||||
|
||||
status:
|
||||
@curl -s $(REGISTRY_IP):5000/v2/_catalog | jq
|
15
initScript/init.sh
Normal file
15
initScript/init.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
app_password=$(cat "$POSTGRES_APP_PASSWORD_FILE")
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE USER docker WITH PASSWORD '$app_password';
|
||||
CREATE DATABASE docker;
|
||||
GRANT ALL PRIVILEGES ON DATABASE docker TO docker;
|
||||
|
||||
-- SELECT datname FROM pg_database WHERE datistemplate = false;
|
||||
-- SELECT table_schema,table_name
|
||||
-- FROM information_schema.tables
|
||||
-- ORDER BY table_schema,table_name;
|
||||
EOSQL
|
Loading…
Reference in New Issue
Block a user