Update Dockerfile
Browse files- Dockerfile +10 -0
Dockerfile
CHANGED
|
@@ -8,5 +8,15 @@ RUN git clone https://github.com/zoreu/mp3app.git .
|
|
| 8 |
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
EXPOSE 7860
|
| 12 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
|
|
|
|
| 8 |
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Criar um usuário não-root
|
| 12 |
+
RUN useradd -m appuser
|
| 13 |
+
|
| 14 |
+
# Definir permissões para as pastas static e downloads
|
| 15 |
+
RUN chown -R appuser:appuser /app/static /app/downloads
|
| 16 |
+
RUN chmod -R 755 /app/static /app/downloads
|
| 17 |
+
|
| 18 |
+
# Mudar para o usuário não-root
|
| 19 |
+
USER appuser
|
| 20 |
+
|
| 21 |
EXPOSE 7860
|
| 22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
|