chore: rename compose files for dev/prod split
- compose.yml is now for development (default) - compose-prod.yml is for production
This commit is contained in:
@@ -1,29 +0,0 @@
|
|||||||
DEV_COMPOSE = docker compose -f compose-dev.yml
|
|
||||||
DEV_GO = /usr/local/go/bin/go
|
|
||||||
|
|
||||||
.PHONY: dev-up dev-shell dev-down dev-logs dev-build dev-run smoke-keyoapp-plain smoke-keyoapp-plain-dev
|
|
||||||
|
|
||||||
dev-build:
|
|
||||||
$(DEV_COMPOSE) build dev
|
|
||||||
|
|
||||||
dev-up:
|
|
||||||
$(DEV_COMPOSE) up -d
|
|
||||||
|
|
||||||
dev-run:
|
|
||||||
$(DEV_COMPOSE) up dev
|
|
||||||
|
|
||||||
dev-shell:
|
|
||||||
$(DEV_COMPOSE) exec dev sh
|
|
||||||
|
|
||||||
dev-down:
|
|
||||||
$(DEV_COMPOSE) down
|
|
||||||
|
|
||||||
dev-logs:
|
|
||||||
$(DEV_COMPOSE) logs -f --tail=100
|
|
||||||
|
|
||||||
smoke-keyoapp-plain:
|
|
||||||
GOYOMI_SMOKE=1 go test -count=1 -v ./sources -run TestStandaloneKeyoappSmoke
|
|
||||||
|
|
||||||
smoke-keyoapp-plain-dev:
|
|
||||||
$(DEV_COMPOSE) up -d postgres flaresolverr dev
|
|
||||||
$(DEV_COMPOSE) exec dev sh -lc "GOYOMI_SMOKE=1 $(DEV_GO) test -count=1 -v ./sources -run TestStandaloneKeyoappSmoke"
|
|
||||||
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
|
flaresolverr:
|
||||||
|
image: ghcr.io/flaresolverr/flaresolverr:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
LOG_LEVEL: info
|
||||||
|
ports:
|
||||||
|
- "8191:8191"
|
||||||
|
|
||||||
|
app:
|
||||||
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file: .env
|
||||||
|
ports:
|
||||||
|
- "${ADDR:-8080}:8080"
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
flaresolverr:
|
||||||
|
condition: service_started
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
+34
-16
@@ -1,4 +1,26 @@
|
|||||||
services:
|
services:
|
||||||
|
dev:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
working_dir: /workspace
|
||||||
|
command: air -c .air.toml
|
||||||
|
tty: true
|
||||||
|
stdin_open: true
|
||||||
|
volumes:
|
||||||
|
- ./:/workspace
|
||||||
|
- go_mod_cache:/go/pkg/mod
|
||||||
|
- go_build_cache:/root/.cache/go-build
|
||||||
|
ports:
|
||||||
|
- "${ADDR:-8080}:8080"
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
flaresolverr:
|
||||||
|
condition: service_started
|
||||||
|
networks:
|
||||||
|
- goyomi_dev
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -7,32 +29,28 @@ services:
|
|||||||
POSTGRES_USER: ${POSTGRES_USER}
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_dev_data:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
networks:
|
||||||
|
- goyomi_dev
|
||||||
|
|
||||||
flaresolverr:
|
flaresolverr:
|
||||||
image: ghcr.io/flaresolverr/flaresolverr:latest
|
image: ghcr.io/flaresolverr/flaresolverr:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
LOG_LEVEL: info
|
LOG_LEVEL: ${FLARESOLVERR_LOG_LEVEL}
|
||||||
ports:
|
networks:
|
||||||
- "8191:8191"
|
- goyomi_dev
|
||||||
|
|
||||||
app:
|
networks:
|
||||||
build: .
|
goyomi_dev:
|
||||||
restart: unless-stopped
|
driver: bridge
|
||||||
env_file: .env
|
|
||||||
ports:
|
|
||||||
- "${ADDR:-8080}:8080"
|
|
||||||
depends_on:
|
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
flaresolverr:
|
|
||||||
condition: service_started
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
go_mod_cache:
|
||||||
|
go_build_cache:
|
||||||
|
postgres_dev_data:
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
# PostgreSQL
|
|
||||||
POSTGRES_DB=goyomi
|
|
||||||
POSTGRES_USER=goyomi
|
|
||||||
POSTGRES_PASSWORD=goyomi
|
|
||||||
|
|
||||||
# App
|
|
||||||
DATABASE_URL=postgres://goyomi:goyomi@postgres:5432/goyomi?sslmode=disable
|
|
||||||
FLARESOLVERR_URL=http://flaresolverr:8191
|
|
||||||
FLARESOLVERR_LOG_LEVEL=info
|
|
||||||
FLARESOLVERR_PROXY=1
|
|
||||||
ADDR=:3300
|
|
||||||
|
|
||||||
# Connection pool
|
|
||||||
DB_MAX_CONNS=10
|
|
||||||
DB_MIN_CONNS=2
|
|
||||||
|
|
||||||
# Cache TTLs (seconds)
|
|
||||||
MANGA_LIST_TTL_SECONDS=600
|
|
||||||
MANGA_DETAIL_TTL_SECONDS=3600
|
|
||||||
CHAPTER_LIST_TTL_SECONDS=600
|
|
||||||
Reference in New Issue
Block a user