mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
77fa8718d9
Still need quite a bit of clean-up, but this adds a working docker-compose + Dockerfile setup
29 lines
1.1 KiB
Docker
29 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM ubuntu:18.04
|
|
|
|
# Install system dependencies and Python packages
|
|
RUN apt-get update -y && \
|
|
apt-get -y install libimage-exiftool-perl
|
|
|
|
FROM continuumio/miniconda3:4.10.3p0-alpine
|
|
|
|
COPY . .
|
|
|
|
# Get the arguments from the docker-compose environment
|
|
ARG PORT
|
|
EXPOSE ${PORT}
|
|
|
|
# This allows us to use the arguments during runtime
|
|
RUN conda env create -f environment.yml
|
|
|
|
# Use the conda environment we created to run the application.
|
|
# The docker execution process run conda activate semantic-search, since the lifetime of the environment would only be for the single command.
|
|
# Instead, we'll use the conda run to run the application.
|
|
# Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/
|
|
# Use sh -c to start a shell in order to use environment variables in CMD.
|
|
ENTRYPOINT ["conda", "run", "--no-capture-output", "--name", "semantic-search", \
|
|
"python3", "-m", "src.main"]
|
|
|
|
# "python3", "-m", "src.main", "-c=${CONFIG_FILE}", "-vv" ,"--host=${HOST}, "--port=${PORT}"]
|
|
|
|
# CMD ["sh", "-c", "echo ${CONFIG_FILE}", "echo ${HOST}", "echo ${PORT}"]
|