-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the local development experience (#6)
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Base image | ||
FROM python:3.10 | ||
|
||
# Install all required packages to run the model | ||
# TODO: 1. Add any additional packages required to run your model | ||
# RUN apt update && apt install --yes package1 package2 ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
services: | ||
service: | ||
container_name: service | ||
build: | ||
context: . | ||
dockerfile: development.Dockerfile | ||
command: | | ||
bash -c " | ||
# Create the virtual environment | ||
python3.10 -m venv .venv && | ||
# Activate the virtual environment | ||
source .venv/bin/activate && | ||
# Install the dependencies | ||
pip install -r requirements.txt -r requirements-all.txt && | ||
# Run the service | ||
cd src && | ||
uvicorn --reload --host 0.0.0.0 --port 9090 main:app | ||
" | ||
environment: | ||
- ENGINE_URLS=["http://host.docker.internal:8080"] | ||
- SERVICE_URL=http://host.docker.internal:9090 | ||
ports: | ||
- 9090:9090 | ||
working_dir: /workspaces/service | ||
volumes: | ||
- .:/workspaces/service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters