update
Browse files- Dockerfile +9 -15
Dockerfile
CHANGED
|
@@ -39,28 +39,22 @@ COPY pyproject.toml poetry.lock* ./
|
|
| 39 |
RUN poetry config virtualenvs.create false \
|
| 40 |
&& poetry install --no-interaction --no-ansi --only main --no-root
|
| 41 |
|
| 42 |
-
#
|
| 43 |
-
RUN
|
| 44 |
-
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
# Install Playwright browsers correctly with the user that will run the app
|
| 50 |
-
RUN playwright install chromium --with-deps
|
| 51 |
-
|
| 52 |
-
# Switch back to root for directory creation
|
| 53 |
-
USER root
|
| 54 |
-
|
| 55 |
-
# Create directories
|
| 56 |
-
RUN mkdir -p static templates screenshots && \
|
| 57 |
-
chown -R user:user /app
|
| 58 |
|
| 59 |
# Copy application code
|
| 60 |
COPY app /app/app
|
| 61 |
COPY templates /app/templates
|
| 62 |
COPY static /app/static
|
| 63 |
|
|
|
|
|
|
|
|
|
|
| 64 |
# Environment variables
|
| 65 |
ENV PORT=7860 \
|
| 66 |
HOST=0.0.0.0 \
|
|
|
|
| 39 |
RUN poetry config virtualenvs.create false \
|
| 40 |
&& poetry install --no-interaction --no-ansi --only main --no-root
|
| 41 |
|
| 42 |
+
# Install Playwright browsers as root
|
| 43 |
+
RUN playwright install chromium && \
|
| 44 |
+
playwright install-deps chromium
|
| 45 |
|
| 46 |
+
# Create directories and set permissions
|
| 47 |
+
RUN mkdir -p static templates screenshots /home/user/.cache && \
|
| 48 |
+
chown -R user:user /app /home/user/.cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
# Copy application code
|
| 51 |
COPY app /app/app
|
| 52 |
COPY templates /app/templates
|
| 53 |
COPY static /app/static
|
| 54 |
|
| 55 |
+
# Make sure all files are owned by user
|
| 56 |
+
RUN chown -R user:user /app
|
| 57 |
+
|
| 58 |
# Environment variables
|
| 59 |
ENV PORT=7860 \
|
| 60 |
HOST=0.0.0.0 \
|