add app and frontend to docker compose

This commit is contained in:
yyasha 2024-01-31 10:29:30 +03:00
parent 9e78692345
commit df5fec15a9
3 changed files with 47 additions and 26 deletions

View File

@ -14,3 +14,7 @@ generate:
go generate ./...
test:
go test ./internal/...
docker_build:
docker build -t registry.computernetthings.ru/recipes/app .
docker_push:
docker push registry.computernetthings.ru/recipes/app

21
config/dev.yaml Normal file
View File

@ -0,0 +1,21 @@
env: "dev" # local / dev / prod
http-server:
address: "0.0.0.0:4444"
timeout: 4s
idle_timeout: 60s
postgresql:
db_name: "pguser"
user: "pguser"
password: "password"
address: "192.168.4.4:5432"
redis:
password: "password"
address: "192.168.4.7:6379"
minio:
user: "user"
password: "password"
address: "192.168.4.5:9000"

View File

@ -19,22 +19,22 @@ services:
# build:
# context: .
# dockerfile: Dockerfile
image: recipes:latest
image: registry.computernetthings.ru/recipes/app:latest
container_name: app
restart: unless-stopped
env_file: .env
environment:
CONFIG_PATH: ./config/local.yaml
CONFIG_PATH: ./config/dev.yaml
depends_on:
- app_pg
- redis
- minio
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.app.entrypoints=websecure"
# - "traefik.http.routers.app.tls=true"
# - "traefik.http.routers.app.tls.certresolver=production"
# - "traefik.http.routers.app.rule=Host(`$API_HOST`)"
labels:
- "traefik.enable=true"
- "traefik.http.routers.recipes_app.entrypoints=websecure"
- "traefik.http.routers.recipes_app.tls=true"
- "traefik.http.routers.recipes_app.tls.certresolver=production"
- "traefik.http.routers.recipes_app.rule=Host(`$API_HOST`)"
networks:
microservicesnet:
ipv4_address: 192.168.4.3
@ -65,8 +65,6 @@ services:
environment:
- MINIO_ROOT_USER=$MINIO_ROOT_USER
- MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD
# volumes:
# - ../docker_data/recipes2_data/minio:/bitnami/minio/data:z
ports:
- '9000:9000'
- '9001:9001'
@ -80,26 +78,24 @@ services:
restart: unless-stopped
env_file: .env
command: redis-server --loglevel warning --requirepass $RDB_PASSWORD # --save 20 1
# volumes:
# - ../docker_data/recipes2_data/cache:/date
networks:
microservicesnet:
ipv4_address: 192.168.4.7
# # frontend
# frontend_service:
# image: registry.computernetthings.ru/parallel/frontend:latest
# container_name: frontend_service
# restart: unless-stopped
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.frontend_service.entrypoints=websecure"
# - "traefik.http.routers.frontend_service.tls=true"
# - "traefik.http.routers.frontend_service.tls.certresolver=production"
# - "traefik.http.routers.frontend_service.rule=Host(`$FRONTEND_HOST`)"
# networks:
# microservicesnet:
# ipv4_address: 192.168.4.6
# frontend
recipes_frontend:
image: registry.computernetthings.ru/recipes/front:latest
container_name: recipes_frontend
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.recipes_frontend.entrypoints=websecure"
- "traefik.http.routers.recipes_frontend.tls=true"
- "traefik.http.routers.recipes_frontend.tls.certresolver=production"
- "traefik.http.routers.recipes_frontend.rule=Host(`$FRONTEND_HOST`)"
networks:
microservicesnet:
ipv4_address: 192.168.4.6
networks:
microservicesnet: