Skip to content

Commit 7584ba7

Browse files
committed
Minor
1 parent b75d028 commit 7584ba7

4 files changed

Lines changed: 30 additions & 132 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
__pycache__/
55
*.py[cod]
66
.venv/
7+
/compose.local.yml
8+
/docker-compose.override.yml
9+
/compose.override.yml

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ up: ## Запустить весь стек (production mode - stable)
1010
docker-compose --env-file .env -f infra/compose/compose.yml up -d
1111

1212
up-dev: ## Запустить весь стек (dev mode with volume mounts)
13-
docker-compose --env-file .env -f infra/compose/compose.yml -f compose.override.yml up -d
13+
docker compose \
14+
-f infra/compose/compose.yml \
15+
-f infra/compose/compose.dev.yml \
16+
-f compose.local.yml \
17+
up -d
1418

1519
build: ## Пересобрать контейнеры (production)
1620
docker-compose --env-file .env -f infra/compose/compose.yml build

infra/compose/compose.override.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

infra/compose/compose.yml

Lines changed: 22 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,30 @@
1-
version: "3.9"
2-
3-
networks:
4-
traefik-public:
5-
external: true
6-
app-net: {}
7-
81
services:
92
api:
10-
image: ${IMAGE_API}:${TAG}
3+
build:
4+
context: ./../../backend
115
env_file:
12-
- ${ENV_FILE}
13-
environment:
14-
# серверная часть (FastAPI) читает эти переменные
15-
- SENTRY_DSN=${SENTRY_DSN}
16-
- DATABASE_URL=${DATABASE_URL}
17-
- REDIS_URL=${REDIS_URL}
18-
- UVICORN_WORKERS=1
19-
deploy:
20-
restart_policy:
21-
condition: on-failure
22-
networks:
23-
- app-net
24-
- traefik-public
25-
expose:
26-
- "8000"
6+
- ./../../backend/.env.local
7+
ports:
8+
- "8000:8000"
9+
depends_on:
10+
- mongo
11+
- redis
2712

28-
worker:
29-
image: ${IMAGE_API}:${TAG}
30-
command: ["celery", "-A", "app.tasks.celery_app", "worker", "--concurrency=4", "-l", "INFO"]
31-
env_file:
32-
- ${ENV_FILE}
13+
web:
14+
build:
15+
context: ./../../frontend
3316
environment:
34-
- SENTRY_DSN=${SENTRY_DSN}
35-
- DATABASE_URL=${DATABASE_URL}
36-
- REDIS_URL=${REDIS_URL}
37-
deploy:
38-
restart_policy:
39-
condition: on-failure
40-
networks:
41-
- app-net
17+
- NEXT_PUBLIC_API_URL=http://localhost:8000/v1
18+
ports:
19+
- "3000:3000"
4220

43-
frontend:
44-
image: ${IMAGE_WEB}:${TAG}
45-
env_file:
46-
- ${ENV_FILE}
47-
environment:
48-
# SSR (сервер) ходит во внутренний API, клиент — во внешний домен
49-
- API_INTERNAL_URL=http://api:8000
50-
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
51-
- SENTRY_DSN=${SENTRY_DSN_FRONT}
52-
- NODE_ENV=production
53-
deploy:
54-
restart_policy:
55-
condition: on-failure
56-
networks:
57-
- app-net
58-
- traefik-public
59-
expose:
60-
- "3000"
21+
mongo:
22+
image: mongo:7
23+
volumes:
24+
- mongo_data:/data/db
6125

6226
redis:
63-
image: redis:7-alpine
64-
command: ["redis-server", "--appendonly", "yes"]
65-
environment:
66-
- REDIS_PASSWORD=${REDIS_PASSWORD}
67-
deploy:
68-
restart_policy:
69-
condition: on-failure
70-
networks:
71-
- app-net
27+
image: redis:7
28+
29+
volumes:
30+
mongo_data:

0 commit comments

Comments
 (0)