feat: Refactor compose file and add minio services

This commit is contained in:
vuonghoainam 2023-08-31 00:24:37 +07:00
parent 6eac9b7d25
commit 949370ad3f

View File

@ -12,13 +12,13 @@ services:
KC_DB_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
KC_DB_USERNAME: ${POSTGRES_USERNAME:-postgres}
KC_DB_SCHEMA: ${KC_DB_SCHEMA:-public}
KC_HEALTH_ENABLED: 'true'
KC_HEALTH_ENABLED: "true"
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD-admin}
volumes:
- ./conf/keycloak_conf:/opt/keycloak/data/import
ports:
- "8088:8088"
- "8088:8088"
depends_on:
keycloak_postgres:
condition: service_healthy
@ -58,7 +58,7 @@ services:
graphql-engine:
image: hasura/graphql-engine:v2.31.0.cli-migrations-v3
ports:
- "8080:8080"
- "8080:8080"
restart: always
env_file:
- conf/sample.env_app-backend
@ -133,7 +133,6 @@ services:
build:
context: ./web-client
dockerfile: ./dev.Dockerfile
container_name: jan_web
restart: always
volumes:
- ./web-client/:/app
@ -191,14 +190,17 @@ services:
# Mount the directory that contains the downloaded model.
volumes:
- ./jan-inference/sd/models:/models/
- ./jan-inference/sd/output/:/output/
command: /bin/bash -c "python -m uvicorn main:app --proxy-headers --host 0.0.0.0 --port 8000"
command: /bin/bash -c "python -m uvicorn main:app --proxy-headers --host 0.0.0.0 --port 8000"
environment:
# Specify the path to the model for the web application.
BASE_URL: http://0.0.0.0:8001
S3_ENDPOINT_URL: ${S3_ENDPOINT_URL}
S3_PUBLIC_ENDPOINT_URL: ${S3_PUBLIC_ENDPOINT_URL}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
MODEL_NAME: ${SD_MODEL_FILE}.q4_0.bin
MODEL_DIR: /models
OUTPUT_DIR: /output
OUTPUT_DIR: /tmp
SD_PATH: /sd
PYTHONUNBUFFERED: 1
ports:
@ -213,6 +215,41 @@ services:
jan_community:
ipv4_address: 172.20.0.21
minio:
image: minio/minio
ports:
- 9000:9000
- 9001:9001
volumes:
- ./minio/data:/export
- ./minio/config:/root/.minio
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY}
command: server /export --console-address ":9001"
networks:
jan_community:
ipv4_address: 172.20.0.23
createbuckets:
image: minio/mc
depends_on:
- minio
environment:
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 ${S3_ACCESS_KEY_ID} ${S3_SECRET_ACCESS_KEY};
/usr/bin/mc rm -r --force myminio/${S3_BUCKET_NAME};
/usr/bin/mc mb myminio/${S3_BUCKET_NAME};
/usr/bin/mc anonymous set public myminio/${S3_BUCKET_NAME};
exit 0;
"
networks:
jan_community:
# Service for Traefik, a modern HTTP reverse proxy and load balancer.
# traefik:
# image: traefik:v2.10
@ -230,10 +267,10 @@ services:
# jan_community:
# ipv4_address: 172.20.0.22
networks:
networks:
jan_community:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/16
- subnet: 172.20.0.0/16