Skip to content

Commit

Permalink
Add docker compose yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
quambene committed Apr 3, 2024
1 parent 980dba3 commit a4d4552
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ rust-toolchain
# Config files
**/*.yaml

# Allow docker-compose.yaml
!docker-compose.yaml

# Data
**/*.csv
**/*.jpg
Expand All @@ -37,6 +40,3 @@ rust-toolchain

# VS Code
**/.vscode

# Docker
docker-compose.yaml
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,23 +445,25 @@ Sendgrid | equals monthly limit

## Testing

Some integration tests require a locally running database, and an AWS SES account.
Specify the following environment variables:

- SMTP
- `SMTP_SERVER`
- `SMTP_USERNAME`
- `SMTP_PASSWORD`
- AWS SES
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_REGION`
- Postgres
- `DB_HOST`
- `DB_PORT`
- `DB_USER`
- `DB_PASSWORD`
- `DB_NAME`
Some integration tests require a locally running database, and an AWS SES
account:

1. Specify the following environment variables:
- SMTP
- `SMTP_SERVER`
- `SMTP_USERNAME`
- `SMTP_PASSWORD`
- AWS SES
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_REGION`
- Postgres
- `DB_HOST`
- `DB_PORT`
- `DB_USER`
- `DB_PASSWORD`
- `DB_NAME`
2. Set up a temporary postgres db: `docker-compose run --rm --service-ports postgres`

``` bash
# Run unit tests and integration tests
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'
services:
postgres:
env_file:
- .env
volumes:
- ./test_data:/docker-entrypoint-initdb.d
image: postgres:16-alpine
restart: "no"
ports:
- "${DB_PORT}:5432"
environment:
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_NAME}"

0 comments on commit a4d4552

Please sign in to comment.