Skip to content

Commit

Permalink
some modification to push the docker image to azure repository
Browse files Browse the repository at this point in the history
  • Loading branch information
truonghm committed Sep 22, 2023
1 parent 8b0f985 commit e769b4e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel

COPY ./api /api
COPY ./src /api/src
COPY ./models/codebert-bimodal/checkpoint-best-aver/ /api/models


WORKDIR /api/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

EXPOSE 8501

ENV API_HOST_PORT=8501
ENV API_HOST_DOMAIN="0.0.0.0"
ENV RELOAD_CODE="False"
ENV NUMBER_OF_WORKERS=4

CMD [ "python", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ crawl:
## render report
render:
quarto render ./report/index.qmd
python -m fitz join -o report/M1-INTERNSHIP-REPORT.pdf report/m1_internship_title_page.pdf report/_book/M1-INTERNSHIP-REPORT.pdf

## preview report
preview:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conda create --name m1 --file conda-linux-64.lock
docker-compose up -d
```

The Swagger page is available at [http://0.0.0.0:9771/documentation](http://0.0.0.0:9771/documentation).
The Swagger page is available at [http://0.0.0.0:8501/documentation](http://0.0.0.0:8501/documentation).

Example request body:

Expand Down
12 changes: 0 additions & 12 deletions api/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion api/app/base/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Settings(object):
MONGO_DB_URI = os.getenv(
"SIMCEL_MONGODB_URI",
)
API_HOST_PORT = int(os.getenv("API_HOST_PORT", 9771))
API_HOST_PORT = int(os.getenv("API_HOST_PORT", 8501))
API_HOST_DOMAIN = os.getenv("API_HOST_DOMAIN", "0.0.0.0")
RELOAD_CODE = os.getenv("RELOAD_CODE", False)
NUMBER_OF_WORKER = int(os.getenv("NUMBER_OF_WORKER", 4))
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ services:
env_file:
- ./api/.env
ports:
- 9771:9771
- 8501:8501
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:9771"]
test: ["CMD", "curl", "-f", "http://0.0.0.0:8501"]
timeout: 30s
retries: 10
volumes:
- ./api:/api
- ./src:/api/src
- ./models/codebert-bimodal/checkpoint-best-aver:/api/models
# volumes:
# - ./api:/api
# - ./src:/api/src
# - ./models/codebert-bimodal/checkpoint-best-aver:/api/models
deploy:
resources:
reservations:
Expand Down

0 comments on commit e769b4e

Please sign in to comment.