diff --git a/DockerFiles/dockComp_master_server.yml b/DockerFiles/dockComp_master_server.yml new file mode 100644 index 0000000..a015c9e --- /dev/null +++ b/DockerFiles/dockComp_master_server.yml @@ -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 diff --git a/DockerFiles/master_server.docker b/DockerFiles/master_server.docker index 17b56a8..a49c63f 100644 --- a/DockerFiles/master_server.docker +++ b/DockerFiles/master_server.docker @@ -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" ] diff --git a/scripts/deploy_master_server.sh b/scripts/deploy_master_server.sh new file mode 100755 index 0000000..f797108 --- /dev/null +++ b/scripts/deploy_master_server.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker-compose -f ../DockerFiles/dockComp_master_server.yml up diff --git a/scripts/deploy_server.sh b/scripts/deploy_server.sh deleted file mode 100755 index 1a24852..0000000 --- a/scripts/deploy_server.sh +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh diff --git a/scripts/init_master_server.sh b/scripts/init_master_server.sh deleted file mode 100755 index dd663a7..0000000 --- a/scripts/init_master_server.sh +++ /dev/null @@ -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