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: