diff --git a/Makefile b/Makefile index f659fb6..fd74ff2 100644 --- a/Makefile +++ b/Makefile @@ -7,18 +7,24 @@ ifeq (,$(shell which uv)) UV ?= python3 -m uv endif +UV ?= uv +RUFF ?= $(UV) run --active ruff +TY ?= $(UV) run --active ty + ifeq (,$(shell which bun)) NPM ?= npm endif -UV ?= uv -RUFF ?= $(UV) run --active ruff -TY ?= $(UV) run --active ty -UNITTEST ?= $(UV) run --active -m unittest -COVERAGE ?= $(UV) run --active coverage -OPEN ?= xdg-open NPM ?= bun +ifeq (,$(shell which podman)) + DOCKER ?= docker +endif + +DOCKER ?= podman + +OPEN ?= xdg-open + # DOCS .PHONY: help @@ -60,6 +66,15 @@ format: ruff-fix ruff-format npm-run-lint-fix ## format project .PHONY: lint lint: ruff ruff-format-check ty npm-run-lint npm-run-type-check ## lint project +.PHONY: start +start: docker-compose-up + +.PHONY: stop +stop: docker-compose-down + +.PHONY: logs +logs: docker-compose-logs + # TOOLS .PHONY: uv-sync @@ -102,6 +117,26 @@ npm-update: ## npm update npm-run-%: node_modules ## npm run (script) $(NPM) run $* +.PHONY: docker-compose-up +docker-compose-up: ## docker compose up + $(DOCKER) compose up -d + +.PHONY: docker-compose-up-% +docker-compose-up-%: ## docker compose up (container) + $(DOCKER) compose up -d $* + +.PHONY: docker-compose-down +docker-compose-down: ## docker compose down + $(DOCKER) compose down --remove-orphans + +.PHONY: docker-compose-down-% +docker-compose-down-%: ## docker compose down (container) + $(DOCKER) compose down --remove-orphans $* + +.PHONY: docker-compose-logs +docker-compose-logs: ## docker compose logs + $(DOCKER) compose logs -f || true + .PHONY: release-% release-%: .venv ## release major/minor/patch $(UV) version --bump=$* diff --git a/bun.lock b/bun.lock index 1d0adee..89a91da 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "tout-doux", diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..0187d35 --- /dev/null +++ b/compose.yml @@ -0,0 +1,27 @@ +networks: + backend: + +services: + app: + image: astral/uv:python3.14-alpine + volumes: + - .:/app + working_dir: /app + environment: + - APP_ENV=dev + - PORT=5000 + - BIND=0.0.0.0 + command: uv run tout-doux --debug + networks: + - backend + + vite: + image: oven/bun:latest + volumes: + - .:/app + working_dir: /app + command: bun run dev + ports: + - "5173:5173" + networks: + - backend diff --git a/vite.config.ts b/vite.config.ts index 71a123d..ec9f532 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ hmr: true, proxy: { "/api": { - target: "http://localhost:5000", + target: "http://app:5000", changeOrigin: true, secure: false, },