Skip to content

Commit ea95107

Browse files
committed
Fix docker container definition
After the major refactor, the Dockerfile was broken. This fixes it, and adapts it to use Python version 3.11 at the same time (as defined in the `pyproject.toml`). Furthermore, this adds a `compose.yaml` for easier deployment. Sadly, however, this introduces #15, as currently we cannot run the container directly via command, as there is a broken path definition.
1 parent 2812d60 commit ea95107

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use the official Alpine Linux as the base image
2-
FROM python:3.9-alpine
2+
FROM python:3.11-alpine
33

44
# Install Git
55
RUN apk update && apk add --no-cache git
@@ -10,11 +10,9 @@ WORKDIR /app
1010
# Copy the package files to the working directory
1111
COPY . .
1212

13-
# Install system dependencies
14-
# RUN apk --no-cache add build-base libffi-dev
15-
1613
# Install Python dependencies
17-
RUN pip install --no-cache-dir -r requirements.txt
14+
RUN python -m pip install --upgrade pip
15+
RUN pip install .
1816

1917
# Set PYTHONPATH to the app directory
2018
ENV PYTHONPATH=/app
@@ -23,4 +21,4 @@ ENV PYTHONPATH=/app
2321
EXPOSE 8000
2422

2523
# Command to run the FastAPI server
26-
CMD ["python", "semantic_matcher/service.py"]
24+
CMD ["python", "semantic_matcher/service.py"]

compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
semantic_matching_service:
3+
build: .
4+
container_name: semantic_matching_service
5+
restart: unless-stopped
6+
ports:
7+
- "8000:8000"
8+
working_dir: /app/semantic_matcher
9+
command: ["python", "service.py"]

0 commit comments

Comments
 (0)