Skip to content

Commit 539e9de

Browse files
committed
Include new docker config
1 parent f75d036 commit 539e9de

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ ENV/
129129
env.bak/
130130
venv.bak/
131131

132+
# Docker Compose ENV
133+
docker-compose.env
134+
132135
# Rodhaj configurations
133136
config.json
134137
config.yml

docker-compose-dev.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ name: "rodhaj-dev"
33
services:
44
postgres:
55
container_name: Rodhaj-Postgres
6-
image: postgres:15
6+
image: rodhaj-pg:dev-latest
7+
build:
8+
context: ./docker/pg
9+
dockerfile: Dockerfile
710
env_file:
8-
- bot/.env
11+
- docker-compose.env
912
volumes:
1013
- postgres_volume:/var/lib/postgresql/data
1114
ports:

docker/pg/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM postgres:15
2+
COPY /init.sh /docker-entrypoint-initdb.d/

docker/pg/init.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
5+
CREATE ROLE rodhaj WITH LOGIN PASSWORD "$RODHAJ_PASSWORD";
6+
CREATE DATABASE rodhaj OWNER rodhaj;
7+
EOSQL

envs/docker.env

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Docker Compose ENV file
2+
# This is used for setting up the PostgreSQL server
3+
# found within the docker compose file
4+
5+
# Docker PostgreSQL root credientials
6+
POSTGRES_USER=postgres
7+
POSTGRES_PASSWORD=password
8+
9+
# Account for the rodhaj user on PostgreSQL
10+
# This is used to create the internal user, rodhaj
11+
RODHAJ_PASSWORD=password

0 commit comments

Comments
 (0)