Skip to content

Commit

Permalink
Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
phlobo committed Dec 4, 2024
1 parent 9dfdae3 commit 8573a5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@ FROM continuumio/miniconda3:latest
# Set the working directory
WORKDIR /

# Copy the application code and requirements file into the container
COPY requirements.txt .
COPY *.py .

# Update the package list and install any dependencies
RUN apt-get update && apt-get install -y \
curl git \
&& rm -rf /var/lib/apt/lists/*

# Create a new conda environment with Python 3.10
RUN conda create --name xmen python=3.10 -y

# Activate the environment and ensure it persists
SHELL ["conda", "run", "-n", "xmen", "/bin/bash", "-c"]

# Copy the application code and requirements file into the container
COPY requirements.txt .
COPY *.py .

# Install binary dependencies from conda
RUN conda install -c conda-forge nmslib cymem murmurhash -y
RUN conda install -n xmen -c conda-forge nmslib cymem murmurhash -y

# Install pip dependencies
RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 5000

# Define the command to run the server with parameters
CMD ["/opt/conda/envs/xmen/python", "run_snomed_german_recommender.py", "--no-gpu", "--port", "5000", "index"]
CMD ["conda", "run", "-n", "xmen", "python3", "run_snomed_german_recommender.py", "--no-gpu", "--port", "5000", "index"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Simple integration of pre-configured [xMEN](https://github.com/hpi-dhc/xmen) pip

### With Docker

- `docker build -t xmen-inception`
- ``
- `docker build -t inception-xmen-snomed .`
- `docker run -m=12g -p 5002:5000 -v "$(pwd)"/xmen_index/index:/index/ inception-xmen-snomed`

### Without Docker

Expand Down

0 comments on commit 8573a5b

Please sign in to comment.