Skip to content
Snippets Groups Projects
Commit 6b93b8f1 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Updated WebUI Dockerfile

parent 5b24fcc1
No related branches found
No related tags found
1 merge request!54Release 2.0.0
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM python:3-slim FROM python:3.9-slim
# Ref: https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ # Ref: https://pythonspeed.com/articles/activate-virtualenv-dockerfile/
# Install dependencies # Install dependencies
RUN apt-get --yes --quiet --quiet update && \ # RUN apt-get --yes --quiet --quiet update && \
apt-get --yes --quiet --quiet install wget g++ && \ # apt-get --yes --quiet --quiet install wget g++ && \
rm -rf /var/lib/apt/lists/* # rm -rf /var/lib/apt/lists/*
# Set Python to show logs as they occur # Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0 ENV PYTHONUNBUFFERED=0
...@@ -30,7 +30,7 @@ ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' ...@@ -30,7 +30,7 @@ ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
# wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ # wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
# chmod +x /bin/grpc_health_probe # chmod +x /bin/grpc_health_probe
# creating a user for security reasons # Creating a user for security reasons
RUN groupadd -r webui && useradd --no-log-init -r -m -g webui webui RUN groupadd -r webui && useradd --no-log-init -r -m -g webui webui
USER webui USER webui
...@@ -42,9 +42,21 @@ WORKDIR /home/webui/teraflow ...@@ -42,9 +42,21 @@ WORKDIR /home/webui/teraflow
ENV VIRTUAL_ENV=/home/webui/venv ENV VIRTUAL_ENV=/home/webui/venv
RUN python3 -m venv ${VIRTUAL_ENV} RUN python3 -m venv ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
COPY --chown=webui:webui webui/requirements.in /home/webui/teraflow/webui/requirements.in
RUN pip install --upgrade pip setuptools wheel pip-tools && pip-compile --output-file=webui/requirements.txt webui/requirements.in # Get generic Python packages
RUN pip install -r webui/requirements.txt RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade setuptools wheel
RUN python3 -m pip install --upgrade pip-tools
# Get common Python packages
# Note: this step enables sharing the previous Docker build steps among all the Python components
COPY --chown=webui:webui common_requirements.in common_requirements.in
RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
RUN python3 -m pip install -r common_requirements.txt
COPY --chown=webui:webui src/webui/requirements.in requirements.in
RUN pip-compile --output-file=requirements.txt requirements.in
RUN pip install -r requirements.txt
# Add files into working directory # Add files into working directory
COPY --chown=webui:webui common/. common COPY --chown=webui:webui common/. common
...@@ -59,5 +71,5 @@ COPY --chown=webui:webui service/proto/. service/proto ...@@ -59,5 +71,5 @@ COPY --chown=webui:webui service/proto/. service/proto
COPY --chown=webui:webui service/client/. service/client COPY --chown=webui:webui service/client/. service/client
COPY --chown=webui:webui webui/. webui COPY --chown=webui:webui webui/. webui
# Start webui service # Start the service
ENTRYPOINT ["python", "-m", "webui.service"] ENTRYPOINT ["python", "-m", "webui.service"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment