tfrere commited on
Commit
31afc96
·
1 Parent(s): 18a23a9

update python

Browse files
Files changed (2) hide show
  1. Dockerfile +18 -8
  2. runtime.txt +1 -0
Dockerfile CHANGED
@@ -6,18 +6,28 @@ COPY client/ ./
6
  ENV VITE_API_URL=https://mistral-ai-game-jam-dont-lookup.hf.space
7
  RUN mkdir -p dist && npm run build
8
 
9
- FROM python:3.9-slim
10
  WORKDIR /app
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Create non-root user
13
  RUN useradd -m -u 1000 user
14
 
15
- # Install system dependencies and poetry
16
- RUN apt-get update && apt-get install -y \
17
- netcat-openbsd \
18
- && rm -rf /var/lib/apt/lists/* \
19
- && pip install poetry
20
-
21
  # Copy and install Python dependencies
22
  COPY server/pyproject.toml server/poetry.lock* ./
23
  RUN poetry config virtualenvs.create false \
@@ -44,4 +54,4 @@ USER user
44
  EXPOSE 7860
45
 
46
  # Start the server
47
- CMD ["python", "-m", "uvicorn", "server.server:app", "--host", "0.0.0.0", "--port", "7860"]
 
6
  ENV VITE_API_URL=https://mistral-ai-game-jam-dont-lookup.hf.space
7
  RUN mkdir -p dist && npm run build
8
 
9
+ FROM python:3.10-slim
10
  WORKDIR /app
11
 
12
+ # Install system dependencies
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ curl \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Install Poetry
19
+ RUN curl -sSL https://install.python-poetry.org | python3 -
20
+
21
+ # Copy project files
22
+ COPY . .
23
+
24
+ # Configure Poetry
25
+ RUN poetry config virtualenvs.create false \
26
+ && poetry install --no-interaction --no-ansi --only main --no-root
27
+
28
  # Create non-root user
29
  RUN useradd -m -u 1000 user
30
 
 
 
 
 
 
 
31
  # Copy and install Python dependencies
32
  COPY server/pyproject.toml server/poetry.lock* ./
33
  RUN poetry config virtualenvs.create false \
 
54
  EXPOSE 7860
55
 
56
  # Start the server
57
+ CMD ["poetry", "run", "python", "server/server.py"]
runtime.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ python-3.10.12