Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +12 -11
Dockerfile
CHANGED
|
@@ -15,28 +15,29 @@ RUN chown -R mediaflow_proxy:mediaflow_proxy /mediaflow_proxy
|
|
| 15 |
# Set up the PATH to include the user's local bin
|
| 16 |
ENV PATH="/home/mediaflow_proxy/.local/bin:$PATH"
|
| 17 |
|
| 18 |
-
# Switch to root user
|
| 19 |
-
USER root
|
| 20 |
-
RUN apt-get update && apt-get install -y git
|
| 21 |
-
|
| 22 |
-
# Switch back to non-root user
|
| 23 |
USER mediaflow_proxy
|
| 24 |
|
| 25 |
-
# Clone the repository
|
| 26 |
-
RUN git clone https://github.com/mhdzumair/mediaflow-proxy.git /mediaflow_proxy
|
| 27 |
-
|
| 28 |
# Install Poetry
|
| 29 |
RUN pip install --user --no-cache-dir poetry
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
# Copy only requirements to cache them in docker layer
|
| 32 |
-
COPY --chown=mediaflow_proxy:mediaflow_proxy pyproject.toml poetry.lock* /mediaflow_proxy/
|
| 33 |
|
| 34 |
# Project initialization:
|
| 35 |
RUN poetry config virtualenvs.in-project true \
|
| 36 |
&& poetry install --no-interaction --no-ansi --no-dev
|
| 37 |
|
| 38 |
-
# Copy project files
|
| 39 |
-
|
| 40 |
|
| 41 |
# Expose the port the app runs on
|
| 42 |
EXPOSE 8080
|
|
|
|
| 15 |
# Set up the PATH to include the user's local bin
|
| 16 |
ENV PATH="/home/mediaflow_proxy/.local/bin:$PATH"
|
| 17 |
|
| 18 |
+
# Switch to non-root user
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
USER mediaflow_proxy
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
# Install Poetry
|
| 22 |
RUN pip install --user --no-cache-dir poetry
|
| 23 |
|
| 24 |
+
# Switch back to root user to install git and clone the repository
|
| 25 |
+
USER root
|
| 26 |
+
RUN apt-get update && apt-get install -y git
|
| 27 |
+
RUN git clone https://github.com/mhdzumair/mediaflow-proxy.git
|
| 28 |
+
|
| 29 |
+
# Switch to non-root user
|
| 30 |
+
USER mediaflow_proxy
|
| 31 |
+
|
| 32 |
# Copy only requirements to cache them in docker layer
|
| 33 |
+
COPY --chown=mediaflow_proxy:mediaflow_proxy mediaflow-proxy/pyproject.toml mediaflow-proxy/poetry.lock* /mediaflow_proxy/
|
| 34 |
|
| 35 |
# Project initialization:
|
| 36 |
RUN poetry config virtualenvs.in-project true \
|
| 37 |
&& poetry install --no-interaction --no-ansi --no-dev
|
| 38 |
|
| 39 |
+
# Copy project files
|
| 40 |
+
COPY --chown=mediaflow_proxy:mediaflow_proxy mediaflow-proxy/ /mediaflow_proxy
|
| 41 |
|
| 42 |
# Expose the port the app runs on
|
| 43 |
EXPOSE 8080
|