Skip to content

Commit

Permalink
feat: add sqlc configuration and postgres to docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-bobo committed Jun 10, 2024
1 parent af0b7d6 commit 2727087
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
version: '3.1'

services:
url-short:
api:
image: url-short:latest
env_file:
- .env
ports:
- 5001:8080
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
restart: always
environment:
PGDATA: /var/lib/postgresql/data/pgdata
PGUSER: url-short
POSTGRES_PASSWORD: password
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- 5002:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 5s
retries: 10
volumes:
pgdata:
8 changes: 8 additions & 0 deletions sqlc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "2"
sql:
- schema: "sql/schema"
queries: "sql/queries"
engine: "postgresql"
gen:
go:
out: "internal/database"

0 comments on commit 2727087

Please sign in to comment.