-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 813 Bytes
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM python:3.11
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
gcc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY src/ ./src/
# Create data directory for SQLite database
RUN mkdir -p data
# Create a non-root user
RUN useradd --create-home --shell /bin/bash app && \
chown -R app:app /app
# Switch to non-root user
USER app
# Expose port for SSE mode
EXPOSE 8080
# Use simple server for demonstration
CMD ["python", "src/server.py"]