From 6ab066d5b697659688200c657d6dad06a4c7f29a Mon Sep 17 00:00:00 2001 From: Will Nilges Date: Fri, 15 Oct 2021 20:55:09 -0400 Subject: [PATCH] Fix docker bad practice --- developing/README.md | 15 +++++++++------ developing/docker-compose.yml | 4 ++-- developing/proxstar-postgres/Dockerfile | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/developing/README.md b/developing/README.md index 59c2ca6..b8b5944 100644 --- a/developing/README.md +++ b/developing/README.md @@ -2,10 +2,14 @@ If you want to work on Proxstar using a 1:1 development setup, there are a couple things you're going to need -- A machine you can SSH into, portforward from, and run Flask, Redis, and Docker on +- A machine you can + - SSH into + - With portforwarding (see `man ssh` for info on the `-L` option) + - and run + - Flask + - Redis + - Docker - At least one (1) Proxmox host running Proxmox >6.3 -- Docker -- SSH portforwarding - A CSH account - An RTP (to tell you secrets) @@ -13,7 +17,7 @@ If you want to work on Proxstar using a 1:1 development setup, there are a coupl I would recommend setting up a development account on your Proxmox node. Name it anything. (Maybe `proxstartest`?). This is necessary to grab authentication tokens and the like. It should have the same permissions as `root@pam`. You can accomplish this by creating a group in `Datacenter > Permissions > Groups` and adding `Administrator` permissions to the group, then adding your user to the group. If you do this, then it's easy to enable/disable it for development. You should also generate an SSH key for the user. -You will also have to set up a pool on your Proxmox node with your csh username. To do this, go into `Datacenter > Permissions > Pools > Create`. +You might also have to set up a pool on your Proxmox node with your CSH username. To do this, go into `Datacenter > Permissions > Pools > Create`. 2. Set up your environment @@ -32,8 +36,7 @@ source venv/bin/activate Install required Python modules ``` pip install -r requirements.txt -pip install click==7.1.2 -pip install python-dotenv +pip install click==7.1.2 python-dotenv ``` Fill out the required fields in your config_local.py file. You might have to come back to this after you run the docker compose. ``` diff --git a/developing/docker-compose.yml b/developing/docker-compose.yml index 8fbe52e..9186280 100644 --- a/developing/docker-compose.yml +++ b/developing/docker-compose.yml @@ -3,12 +3,12 @@ services: proxstar-redis: image: "redis:alpine" ports: - - 6379:6379 + - 127.0.0.1:6379:6379 proxstar-postgres: build: ./proxstar-postgres # image: postgres # restart: always ports: - - 5432:5432 + - 127.0.0.1:5432:5432 environment: POSTGRES_PASSWORD: tits12348 diff --git a/developing/proxstar-postgres/Dockerfile b/developing/proxstar-postgres/Dockerfile index 5769976..7bfb3c6 100644 --- a/developing/proxstar-postgres/Dockerfile +++ b/developing/proxstar-postgres/Dockerfile @@ -8,4 +8,4 @@ RUN apt-get update \ #COPY ./schema/large.sql /docker-entrypoint-initdb.d/ # Woa there, pal; That's a lot of S C H E M A. # I volunteer as tribute. DM me if this breaks. -ADD https://csh.rit.edu/~wilnil/proxstar-postgres/large.sql /docker-entrypoint-initdb.d/ +RUN curl https://csh.rit.edu/~wilnil/proxstar-postgres/large.sql -o /docker-entrypoint-initdb.d/large.sql