Skip to content

Commit

Permalink
Include new docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 committed Jan 17, 2024
1 parent f75d036 commit 539e9de
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ ENV/
env.bak/
venv.bak/

# Docker Compose ENV
docker-compose.env

# Rodhaj configurations
config.json
config.yml
Expand Down
7 changes: 5 additions & 2 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ name: "rodhaj-dev"
services:
postgres:
container_name: Rodhaj-Postgres
image: postgres:15
image: rodhaj-pg:dev-latest
build:
context: ./docker/pg
dockerfile: Dockerfile
env_file:
- bot/.env
- docker-compose.env
volumes:
- postgres_volume:/var/lib/postgresql/data
ports:
Expand Down
2 changes: 2 additions & 0 deletions docker/pg/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM postgres:15
COPY /init.sh /docker-entrypoint-initdb.d/
7 changes: 7 additions & 0 deletions docker/pg/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE ROLE rodhaj WITH LOGIN PASSWORD "$RODHAJ_PASSWORD";
CREATE DATABASE rodhaj OWNER rodhaj;
EOSQL
11 changes: 11 additions & 0 deletions envs/docker.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Docker Compose ENV file
# This is used for setting up the PostgreSQL server
# found within the docker compose file

# Docker PostgreSQL root credientials
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password

# Account for the rodhaj user on PostgreSQL
# This is used to create the internal user, rodhaj
RODHAJ_PASSWORD=password

0 comments on commit 539e9de

Please sign in to comment.