11eedcde84
- renamed package to mwmbl in pyproject.toml - tinysearchengine and indexer modules have been moved into mwmbl package folder - analyse module has been left as is in the root of the repo - import statements in tinysearchengine now use mwmbl.tinysearchengine - import statements in indexer now use mwmbl.indexer or mwmbl.tinysearchengine or relative imports like .paths - import statements in analyse now use mwmbl.indexer or mwmbl.tinysearchengine - final CMD in Dockerfile now uses updated path mwmbl.tinysearchengine.app - fixed a couple of import statement errors in tinysearchengine/indexer.py
34 lines
844 B
Docker
34 lines
844 B
Docker
FROM python:3.9-slim-bullseye as base
|
|
|
|
ENV PYTHONFAULTHANDLER=1 \
|
|
PYTHONHASHSEED=random \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
FROM base as builder
|
|
|
|
ENV PIP_DEFAULT_TIMEOUT=100 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
POETRY_VERSION=1.1.12
|
|
|
|
# RUN apk add --no-cache gcc libffi-dev musl-dev postgresql-dev
|
|
RUN pip install "poetry==$POETRY_VERSION"
|
|
RUN python -m venv /venv
|
|
|
|
COPY pyproject.toml poetry.lock ./
|
|
RUN poetry export -f requirements.txt | /venv/bin/pip install -r /dev/stdin
|
|
|
|
COPY . .
|
|
RUN poetry build && /venv/bin/pip install dist/*.whl
|
|
|
|
FROM base as final
|
|
|
|
#RUN apk add --no-cache libffi libpq
|
|
COPY --from=builder /venv /venv
|
|
COPY data /data
|
|
#COPY docker-entrypoint.sh wsgi.py ./
|
|
#CMD ["./docker-entrypoint.sh"]
|
|
|
|
CMD ["/venv/bin/python", "-m", "mwmbl.tinysearchengine.app", "/data/index.tinysearch"]
|