mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Working example with docker-compose
Still need quite a bit of clean-up, but this adds a working docker-compose + Dockerfile setup
This commit is contained in:
26
Dockerfile
26
Dockerfile
@@ -5,17 +5,25 @@ FROM ubuntu:18.04
|
||||
RUN apt-get update -y && \
|
||||
apt-get -y install libimage-exiftool-perl
|
||||
|
||||
FROM continuumio/miniconda3
|
||||
FROM continuumio/miniconda3:4.10.3p0-alpine
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
|
||||
COPY environment.yml .
|
||||
COPY config.yml .
|
||||
# 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
|
||||
|
||||
EXPOSE 5000
|
||||
COPY . .
|
||||
# CMD python3 -m main -c=config.yml -vv
|
||||
CMD ["conda", "run", "--name", "semantic-search", "python3", "-m", "main", "-c=config.yml", "-vv"]
|
||||
# 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}"]
|
||||
|
||||
Reference in New Issue
Block a user