Open CutTheWire opened 2 months ago
디렉토리 구조
📦ChatBot_Docker ┣ 📂fastapi ┃ ┣ 📂batchfile ┃ ┃ ┣ 📜venv_install.bat ┃ ┃ ┗ 📜venv_setup.bat ┃ ┣ 📂sources ┃ ┃ ┣ 📂utils ┃ ┃ ┃ ┣ 📜Error_handlers.py ┃ ┃ ┃ ┣ 📜Models.py ┃ ┃ ┃ ┗ 📜DB_mongo.py ┃ ┃ ┣ 📜.env ***#3*** ┃ ┃ ┣ 📜server.py ┃ ┣ 📜.DS_Store ┃ ┣ 📜Dockerfile ┃ ┗ 📜requirements.txt ┣ 📂k8s ┃ ┗ 📜secret.yaml ┣ 📂mongo ┃ ┣ 📜.env ***#2*** ┃ ┣ 📜init_db.py ┃ ┣ 📜Dockerfile ┃ ┗ 📜mongod.conf ┣ 📂mysql ┃ ┣ 📜Dockerfile ┃ ┣ 📜init.sql ┃ ┗ 📜log.cnf ┣ 📂nginx ┃ ┣ 📂frontpage-react ┃ ┣ 📜Dockerfile ┃ ┣ 📜package-lock.json ┃ ┗ 📜nginx.conf ┣ 📂springboot/src/main/resources ┃ ┗ 📜application.properties ***#4*** ┣ 📜.env ***#1*** ┣ 📜.gitignore ┣ 📜docker-compose.yml ┣ 📜readme.md ┗ 📜rebuild.bat
GCP 파일 링크 [# *]
./.env [# 1]
# 최상위 .env 파일 MYSQL_DATABASE=chatbot MYSQL_ROOT_HOST=mysql MYSQL_ROOT_USER=root MYSQL_ROOT_PASSWORD=1234 MONGO_DATABASE=chatbot MONGO_ADMIN_USER=root MONGO_ADMIN_PASSWORD=1234 MONGO_HOST=mongodb MONGO_PORT=27017 MONGO_AUTH=admin # EC2 환경 변수 (필요 시) secrets.EC2_HOST= secrets.EC2_USER= secrets.EC2_SSH_KEY=
./mongo/.env [# 2]
MONGO_ADMIN_USER=root MONGO_ADMIN_PASSWORD=1234 MONGO_DATABASE=chatbot MONGO_HOST=localhost MONGO_PORT=27017
./fastapi/sources/.env [# 3]
MYSQL_ROOT_USER=root MYSQL_ROOT_PASSWORD=1234 MYSQL_DATABASE=chatbot MYSQL_ROOT_HOST=mysql MYSQL_ROOT_PORT=3306 MONGO_ADMIN_USER=root MONGO_ADMIN_PASSWORD=1234 MONGO_DATABASE=chatbot MONGO_HOST=mongodb MONGO_AUTH=admin
./springboot/src/main/resources/application.properties [# 4]
spring.application.name=ChatBot_Backend spring.datasource.url=jdbc:mysql://mysql:3306/chatbot?useSSL=false spring.datasource.username=root spring.datasource.password=1234 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect spring.security.user.name=root spring.security.user.password=1234 jwt.secret=8f5c2e8c8a3f91dcbf8e9d4a2e8c4f1e4b2e5a3b9e8a4d5f1c2a3b4d6e7f8a9c
./k8s/secret.yaml [# 5]
apiVersion: v1 kind: Secret metadata: name: treenut type: kubernetes.io/dockerconfigjson data: .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOiB7CgkJCSJhdXRoIjogImFtZHJhVzB4TkRwa1kydHlYM0JoZEY5TFpFc3dia2M1ZWxaQ1ZFZDZiM2N4YUhCc1RrTmZNVzVhVGtrPSIKCQl9LAoJCSJodHRwczovL2luZGV4LmRvY2tlci5pby92MS9hY2Nlc3MtdG9rZW4iOiB7CgkJCSJhdXRoIjogImFtZHJhVzB4TkRwbGVVcG9Za2RqYVU5cFNsTlZla2t4VG1sSmMwbHVValZqUTBrMlNXdHdXRlpEU1hOSmJYUndXa05KTmtsdWFGbGhNMEpEWkVST2VWWXpUWGxTZVRFeFdXcHNjMk5GY0c1alUwbzVMbVY1U205a1NGSjNZM3B2ZGt3eWFERlphVFZyWWpKT2NscFlTWFZaTWpsMFNXcHdOMGx0Vm5SWlYyeHpTV3B2YVdGdFpISmhWekI0VGtSS1FXSnRSakphV0VsMVdUSTVkRWxwZDJsak1sWjZZekpzZG1K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name: mongodb-secret type: Opaque data: MONGO_INITDB_ROOT_USERNAME: cm9vdA== # base64 인코딩된 "root" MONGO_INITDB_ROOT_PASSWORD: MTIzNA== # base64 인코딩된 "1234" MONGO_DATABASE: Y2hhdGJvdA== # base64 인코딩된 "chatbot" --- apiVersion: v1 kind: Secret metadata: name: mysql-secret type: Opaque data: MYSQL_ROOT_PASSWORD: MTIzNA== # base64 인코딩된 "1234" MYSQL_DATABASE: Y2hhdGJvdA== # base64 인코딩된 "chatbot"
Chatbot_Docker
디렉토리 구조
GCP 파일 링크 [# *]
./.env [# 1]
./mongo/.env [# 2]
./fastapi/sources/.env [# 3]
./springboot/src/main/resources/application.properties [# 4]
./k8s/secret.yaml [# 5]