[SOMA][BOT-3][INFRA] skeleton: project folder structure and all package manifests
This commit is contained in:
30
soma/backend/Dockerfile
Normal file
30
soma/backend/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# System deps
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
libpq-dev \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Python dependencies before copying app code
|
||||
# (layer cache: dependencies change less often than code)
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Create uploads directory
|
||||
RUN mkdir -p /app/uploads
|
||||
|
||||
# Non-root user for security
|
||||
RUN addgroup --system appgroup && adduser --system --group appgroup
|
||||
RUN chown -R appgroup:appgroup /app
|
||||
USER appgroup
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|
||||
Reference in New Issue
Block a user