42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
services:
|
|
postgres:
|
|
build:
|
|
target: postgres
|
|
context: .
|
|
args: &args
|
|
AIR_VER: ${AIR_VER}
|
|
ALPINE_VER: ${ALPINE_VER}
|
|
GO_VER: ${GO_VER}
|
|
POSTGRES_VER: ${POSTGRES_VER}
|
|
image: harbor.grachevko.ru/grachevko/h-skills/postgres:dev
|
|
labels:
|
|
ru.grachevko.dhu: 'postgres.h-skills.local'
|
|
environment:
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
PGDATABASE: postgres
|
|
PGUSER: postgres
|
|
PGPASSWORD: postgres
|
|
volumes:
|
|
- type: tmpfs
|
|
target: /var/lib/postgresql/data
|
|
tmpfs:
|
|
size: 4294967296
|
|
|
|
api:
|
|
build:
|
|
target: golang
|
|
args: *args
|
|
command: air --build.cmd "go build -o ./tmp/api ./cmd/api/" --build.bin "./tmp/api"
|
|
labels:
|
|
ru.grachevko.dhu: 'api.h-skills.local'
|
|
environment:
|
|
GOPATH: ${GOPATH}
|
|
working_dir: /app
|
|
volumes:
|
|
- ./:/app
|
|
- ${GOPATH}:${GOPATH}
|
|
- ${HOME}/.cache/go-build:/.cache/go-build
|
|
user: ${USER_ID}:${GROUP_ID}
|