db: use docker compose
This commit is contained in:
parent
f03838d61d
commit
3f53b32e8b
|
@ -0,0 +1,15 @@
|
|||
version: '3.1'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_DB: pt_db
|
||||
POSTGRES_USER: pt_usr
|
||||
POSTGRES_PASSWORD: test
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:8080
|
|
@ -3,9 +3,6 @@ FROM archlinux
|
|||
RUN pacman --noconfirm -Syu
|
||||
RUN pacman --noconfirm -S bash
|
||||
|
||||
# Set up PostgreSQL
|
||||
RUN pacman --noconfirm -S postgresql
|
||||
|
||||
# Set up Rust
|
||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||
CARGO_HOME=/usr/local/cargo \
|
||||
|
@ -15,6 +12,3 @@ RUN curl --proto '=https' -tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
|
|||
RUN chmod +x rustup.sh
|
||||
RUN ./rustup.sh -y
|
||||
RUN rm rustup.sh
|
||||
|
||||
# Run the master server initialization
|
||||
ENTRYPOINT [ "/pt_proj/scripts/init_master_server.sh" ]
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
docker-compose -f ../DockerFiles/dockComp_master_server.yml up
|
|
@ -1 +0,0 @@
|
|||
#!/bin/sh
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Set up postgresql config files
|
||||
su
|
||||
echo "listen_addresses = 'localhost'" > /var/lib/postgres/data/postgresql.conf
|
||||
# TYPE DBs ADDRESS AUTH
|
||||
echo "local pt_db 127.0.0.1/32 md5" > /var/lib/postgres/data/pg_hba.conf
|
||||
|
||||
# Start postgresql
|
||||
systemctl start postgresql.service
|
||||
|
||||
# Set up data 'cluster'
|
||||
su -l postgres
|
||||
initdb --locale=en_US.UTF-8 -E UTF8 -D /var/lib/postgres/data
|
||||
|
||||
# Set up pt_usr
|
||||
su
|
||||
useradd -ms /bin/bash pt_usr
|
||||
su -l postgres
|
||||
createuser pt_usr
|
||||
createdb pt_db
|
Loading…
Reference in New Issue