Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions gptcache_server/dockerfiles/Dockerfile.nx
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
FROM python:3.9.18-slim-bullseye
# Preparing gptcache Build
FROM python:3.9-slim as builder

WORKDIR /app
RUN pip install --upgrade pip >/dev/null 2>&1

COPY requirements.txt requirements.txt
WORKDIR /app

RUN pip install -r requirements.txt
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN pip install --upgrade pip
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

RUN pip install poetry
COPY . .
RUN poetry install
RUN poetry build

# Copying Build
FROM python:3.9-slim as builder1

RUN pip install --upgrade pip >/dev/null 2>&1

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

COPY --from=builder /app/dist /opt/dist

RUN pip install /opt/dist/gptcache-0.1.42-py3-none-any.whl

# Installing Build
FROM python:3.9-slim

COPY --from=builder1 /opt/venv /opt/venv

WORKDIR /app

RUN python setup.py install
ENV PATH="/opt/venv/bin:$PATH"

EXPOSE 8000

ENTRYPOINT ["gptcache_server", "-s", "0.0.0.0", "-p", "8000"]
# CMD ["python", "gptcache_server/server.py"]
ENTRYPOINT ["gptcache_server", "-s", "0.0.0.0", "-p", "8000"]
Loading