Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Oct 27, 2023
1 parent 0f531fd commit c3a4de9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

## creating building container
FROM python:3.10-slim AS builder
FROM python:3.10.9-slim-bullseye AS builder
# update and install dependencies
RUN apt update
RUN apt upgrade -y
Expand All @@ -26,14 +26,18 @@ WORKDIR /service
RUN python -m build

# creating running container
FROM python:3.10-slim
FROM python:3.10.9-slim-bullseye
# update and install dependencies
RUN apt update
RUN apt upgrade -y
# copy and install wheel
# copy and install requirements and wheel
WORKDIR /service
COPY --from=builder /service/requirements.txt /service
RUN pip install --no-deps -r requirements.txt
RUN rm requirements.txt
COPY --from=builder /service/dist/ /service
RUN pip install *.whl
RUN pip install --no-deps *.whl
RUN rm *.whl
# create new user and execute as that user
RUN useradd --create-home appuser
WORKDIR /home/appuser
Expand Down

0 comments on commit c3a4de9

Please sign in to comment.