diff --git a/development.Dockerfile b/development.Dockerfile new file mode 100644 index 0000000..1057484 --- /dev/null +++ b/development.Dockerfile @@ -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 ... diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0808fbb --- /dev/null +++ b/docker-compose.yml @@ -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 diff --git a/src/main.py b/src/main.py index 2002bc0..80f7c05 100644 --- a/src/main.py +++ b/src/main.py @@ -71,8 +71,8 @@ def __init__(self): # TODO: 5. CHANGE THE PROCESS METHOD (CORE OF THE SERVICE) def process(self, data): # NOTE that the data is a dictionary with the keys being the field names set in the data_in_fields - raw = data["image"].data - input_type = data["image"].type + # raw = data["image"].data + # input_type = data["image"].type # ... do something with the raw data # NOTE that the result must be a dictionary with the keys being the field names set in the data_out_fields