|
FROM node:18 as client-build |
|
WORKDIR /app |
|
COPY client/package*.json ./ |
|
RUN npm install |
|
COPY client/ ./ |
|
ENV VITE_API_URL=https://mistral-ai-game-jam-dont-lookup.hf.space |
|
RUN npm run build |
|
|
|
FROM python:3.9-slim |
|
WORKDIR /app |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
netcat-openbsd \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& pip install poetry |
|
|
|
|
|
COPY server/pyproject.toml server/poetry.lock* ./ |
|
RUN poetry config virtualenvs.create false \ |
|
&& poetry install --no-interaction --no-ansi --only main --no-root |
|
|
|
|
|
COPY server/ ./server/ |
|
|
|
|
|
COPY --from=client-build /app/dist ./static |
|
|
|
|
|
ENV API_HOST=0.0.0.0 \ |
|
API_PORT=7860 \ |
|
STATIC_FILES_DIR=static \ |
|
DOCKER_ENV=true |
|
|
|
|
|
RUN mkdir -p /app/cache && chown -R user:user /app/cache |
|
|
|
|
|
USER user |
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "-m", "uvicorn", "server.server:app", "--host", "0.0.0.0", "--port", "7860"] |