ParentalControl / Dockerfile
GitLab CI
Update game build from GitLab CI
d2e1f69
raw
history blame
1.32 kB
# Utiliser Python 3.10 comme base
FROM python:3.10-slim
# Installer poetry
RUN pip install poetry
# Create a non-root user
RUN useradd -m -u 1000 appuser
# Définir le répertoire de travail
WORKDIR /app
# Install system dependencies for PyAudio before poetry install
RUN apt-get update && apt-get install -y \
gcc \
portaudio19-dev \
python3-dev \
libasound2-dev \
libpulse-dev \
libportaudio2 \
libportaudiocpp0 \
libasound2 \
libasound2-data \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copier les fichiers de dépendances
COPY poetry.lock pyproject.toml ./
COPY . .
# Configurer poetry pour ne pas créer un environnement virtuel
RUN poetry config virtualenvs.create false
# Installer les dépendances sans installer le projet lui-même
RUN poetry install --only main --no-interaction --no-ansi --no-root
# Create static directory and set permissions
RUN mkdir -p /app/server/static && \
chown -R appuser:appuser /app && \
# Verify the static files are present
ls -la /app/server/static
# Switch to non-root user
USER appuser
# Verify permissions after user switch
RUN ls -la ~ && \
mkdir -p ~/static && \
ls -la ~/static
# Exposer le port utilisé par Flask
EXPOSE 7860
# Commande pour démarrer l'application
CMD ["python", "-m", "server"]