Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add docker-compose local dev env #840

Merged
merged 1 commit into from
Mar 24, 2022
Merged
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
45 changes: 45 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# this file is used to bootstrap services to run tegola tests against
version: "3"

services:
redis:
image: redis:6.2.6
container_name: redis
ports:
- 6379:6379

postgis:
image: postgis/postgis:12-3.0-alpine
container_name: postgis
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432

migration:
image: postgis/postgis:12-3.0-alpine
container_name: migration
depends_on:
postgis:
condition: service_healthy
environment:
PGUSER: postgres
PGPASSWORD: postgres
command:
- /bin/bash
- -c
- |
wget "https://github.com/go-spatial/tegola-testdata/raw/master/tegola.dump"
psql -h postgis -p 5432 -U postgres -d postgres -c "DROP DATABASE IF EXISTS tegola;"
pg_restore -h postgis -p 5432 -U postgres -d postgres -C tegola.dump
psql -h postgis -U postgres -d postgres -c "DROP ROLE IF EXISTS tegola_no_access;CREATE ROLE tegola_no_access LOGIN PASSWORD 'postgres'"
rm tegola.dump


2 changes: 1 addition & 1 deletion provider/postgis/util_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestDecipherFields(t *testing.T) {
}

host := os.Getenv("PGHOST")
port := 5432
port := os.Getenv("PGPORT")
db := os.Getenv("PGDATABASE")
user := os.Getenv("PGUSER")
password := os.Getenv("PGPASSWORD")
Expand Down