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