Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
44 changes: 44 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -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: