From 6fe63f0afe5dc72dd30675a8a83487abedcdb1b6 Mon Sep 17 00:00:00 2001 From: tmcnulty387 Date: Mon, 16 Feb 2026 15:51:26 -0500 Subject: [PATCH 1/2] Made dev compose file so u don't have to rebuild everytime you make changes --- README.md | 16 +++++++++++++++ docker-compose.dev.yaml | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 docker-compose.dev.yaml diff --git a/README.md b/README.md index e3ae5f0..795411c 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,22 @@ VOTE_SLACK_BOT_TOKEN= `DEV_DISABLE_ACTIVE_FILTERS="true"` will disable the requirements that you be active to vote `DEV_FORCE_IS_EVALS="true"` will force vote to treat all users as the Evals director +## Docker Compose + +Use `docker-compose.dev.yaml` to have code bind with the container, meaning you don't have +to rebuild the container every time you make changes. + +```bash +# dev +podman compose -f docker-compose.dev.yaml up # rerun this to load changes + +## load changes +podman compose down; podman compose -f docker-compose.dev.yaml up + +# prod +podman compose up --build +``` + ## Linting These will be checked by CI diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 0000000..4902a92 --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,44 @@ +version: "3" +services: + vote: + build: + context: . + target: build + working_dir: /src + command: ["go", "run", "./..."] + volumes: + - type: bind + source: . + target: /src + container_name: vote + depends_on: + - mongodb + environment: + VOTE_HOST: 'http://localhost:8080' + VOTE_JWT_SECRET: 4874c601dda90a01c7543c571be08680 + VOTE_MONGODB_URI: "mongodb://vote:c1f66aac6b4fafbef3c659371b8a50ed@mongodb/vote?authSource=admin" + VOTE_OIDC_ID: vote-dev + VOTE_OIDC_SECRET: "${VOTE_OIDC_SECRET}" + VOTE_STATE: 27a28540e47ec786b7bdad03f83171b3 + DEV_DISABLE_ACTIVE_FILTERS: "${DEV_DISABLE_ACTIVE_FILTERS}" + DEV_FORCE_IS_EVALS: "${DEV_FORCE_IS_EVALS}" + ports: + - "127.0.0.1:8080:8080" + + mongodb: + image: docker.io/mongo:4.4.26-focal + container_name: mongodb + command: "mongod --bind_ip 0.0.0.0" + environment: + - "MONGO_INITDB_DATABASE=vote" + - "MONGO_INITDB_ROOT_USERNAME=vote" + - "MONGO_INITDB_ROOT_PASSWORD=c1f66aac6b4fafbef3c659371b8a50ed" + ports: + - "127.0.0.1:27017:27017" + volumes: + - type: volume + source: mongodb + target: /data/db/ + +volumes: + mongodb: From cb392ca95d5260aec437ebaaa02d96c37a5e267c Mon Sep 17 00:00:00 2001 From: tmcnulty387 Date: Tue, 17 Feb 2026 16:06:52 -0500 Subject: [PATCH 2/2] Merged dev and normal compose files --- README.md | 16 --------------- docker-compose.dev.yaml | 44 ----------------------------------------- docker-compose.yaml | 10 +++++++++- 3 files changed, 9 insertions(+), 61 deletions(-) delete mode 100644 docker-compose.dev.yaml diff --git a/README.md b/README.md index 795411c..e3ae5f0 100644 --- a/README.md +++ b/README.md @@ -33,22 +33,6 @@ VOTE_SLACK_BOT_TOKEN= `DEV_DISABLE_ACTIVE_FILTERS="true"` will disable the requirements that you be active to vote `DEV_FORCE_IS_EVALS="true"` will force vote to treat all users as the Evals director -## Docker Compose - -Use `docker-compose.dev.yaml` to have code bind with the container, meaning you don't have -to rebuild the container every time you make changes. - -```bash -# dev -podman compose -f docker-compose.dev.yaml up # rerun this to load changes - -## load changes -podman compose down; podman compose -f docker-compose.dev.yaml up - -# prod -podman compose up --build -``` - ## Linting These will be checked by CI diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml deleted file mode 100644 index 4902a92..0000000 --- a/docker-compose.dev.yaml +++ /dev/null @@ -1,44 +0,0 @@ -version: "3" -services: - vote: - build: - context: . - target: build - working_dir: /src - command: ["go", "run", "./..."] - volumes: - - type: bind - source: . - target: /src - container_name: vote - depends_on: - - mongodb - environment: - VOTE_HOST: 'http://localhost:8080' - VOTE_JWT_SECRET: 4874c601dda90a01c7543c571be08680 - VOTE_MONGODB_URI: "mongodb://vote:c1f66aac6b4fafbef3c659371b8a50ed@mongodb/vote?authSource=admin" - VOTE_OIDC_ID: vote-dev - VOTE_OIDC_SECRET: "${VOTE_OIDC_SECRET}" - VOTE_STATE: 27a28540e47ec786b7bdad03f83171b3 - DEV_DISABLE_ACTIVE_FILTERS: "${DEV_DISABLE_ACTIVE_FILTERS}" - DEV_FORCE_IS_EVALS: "${DEV_FORCE_IS_EVALS}" - ports: - - "127.0.0.1:8080:8080" - - mongodb: - image: docker.io/mongo:4.4.26-focal - container_name: mongodb - command: "mongod --bind_ip 0.0.0.0" - environment: - - "MONGO_INITDB_DATABASE=vote" - - "MONGO_INITDB_ROOT_USERNAME=vote" - - "MONGO_INITDB_ROOT_PASSWORD=c1f66aac6b4fafbef3c659371b8a50ed" - ports: - - "127.0.0.1:27017:27017" - volumes: - - type: volume - source: mongodb - target: /data/db/ - -volumes: - mongodb: diff --git a/docker-compose.yaml b/docker-compose.yaml index 22f5f75..4902a92 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,15 @@ version: "3" services: vote: - build: . + build: + context: . + target: build + working_dir: /src + command: ["go", "run", "./..."] + volumes: + - type: bind + source: . + target: /src container_name: vote depends_on: - mongodb