Commit 1d71b145 authored by Ai-Sasit's avatar Ai-Sasit

update docker image

parent f577aaae
#
FROM python:3.9
#
WORKDIR /code
#
COPY ./requirements.txt /code/requirements.txt
#
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
#
COPY ./server /code/server
#
CMD ["uvicorn", "server.core:app", "--host", "0.0.0.0", "--port", "80"]
version: '3'
services:
web:
server:
container_name: easybistro-api
build: .
ports:
- "80:80"
- "5000:80"
depends_on:
- mongodb
mongodb:
image: mongo:latest
container_name: database
container_name: easybistro-database
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: easybistro
MONGO_INITDB_ROOT_PASSWORD: xejP3257
mongo-express:
image: mongo-express:latest
container_name: mongo-monitor
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: easybistro
ME_CONFIG_MONGODB_ADMINPASSWORD: xejP3257
ME_CONFIG_MONGODB_SERVER: database
depends_on:
- mongodb
- web
......@@ -2,7 +2,7 @@ import pymongo
def get_connection(collection:str):
client = pymongo.MongoClient('mongodb://easybistro:xejP3257@database/Easybistro?authSource=admin&retryWrites=true&w=majority')
client = pymongo.MongoClient('mongodb://easybistro:xejP3257@easybistro-database/Easybistro?authSource=admin&retryWrites=true&w=majority')
return client['easybistro'][collection]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment