Skip to content

Commit

Permalink
Merge pull request #55 from harshraj22/multi_stage_build
Browse files Browse the repository at this point in the history
Multistage build to reduce the size of docker image for frontend service
  • Loading branch information
harshraj22 authored Feb 7, 2023
2 parents 234ae89 + c9284a9 commit 87c43d7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
FROM python:3.8
FROM python:3.8 as compile-image


RUN python3 -m venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

FROM python:3.8-slim AS build-image
COPY --from=compile-image /opt/venv/ /opt/venv/

# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"

WORKDIR /app
# https://github.com/streamlit/streamlit/issues/4842#issuecomment-1198455834
COPY . .
RUN mkdir -p db

Expand Down

0 comments on commit 87c43d7

Please sign in to comment.