Skip to content

Commit

Permalink
[#3688] Use specific volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Feb 12, 2024
1 parent dbe4793 commit 5738c08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docker/docker-compose.objects-apis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ services:
db:
image: postgres:${PG_VERSION:-14}
environment:
- POSTGRES_USER=${DB_USER:-objecttypes}
- POSTGRES_PASSWORD=${DB_PASSWORD:-objecttypes}
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./objects-apis/docker-init-objecttypes-api-db.sql:/docker-entrypoint-initdb.d/init_db.sql
- objects-apis-db:/var/lib/postgresql/data

objecttypes-web:
image: maykinmedia/objecttypes-api:${OBJECTTYPES_VERSION:-2.1.1}
Expand All @@ -17,3 +19,6 @@ services:
- 8001:8000
depends_on:
- db

volumes:
objects-apis-db:
5 changes: 5 additions & 0 deletions docker/objects-apis/docker-init-objecttypes-api-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE USER objecttypes;
CREATE DATABASE objecttypes;
GRANT ALL PRIVILEGES ON DATABASE objecttypes TO objecttypes;
-- On Postgres 15+, connect to the database and grant schema permissions.
-- GRANT USAGE, CREATE ON SCHEMA public TO objecttypes;

0 comments on commit 5738c08

Please sign in to comment.