Skip to content

Commit

Permalink
remove s6-overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
lawndoc committed Nov 14, 2023
1 parent 7280f5e commit 67c3086
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Builder image
# using ubuntu LTS version
FROM lsiobase/ubuntu:jammy AS builder-image
FROM ubuntu:latest AS builder-image

# avoid stuck build due to user prompt
ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -11,24 +11,23 @@ RUN apt-get update && apt-get install --no-install-recommends -y python3.11 pyth

# create and activate virtual environment
# using final folder name to avoid path issues with packages
RUN python3.11 -m venv /home/abc/venv
ENV PATH="/home/abc/venv/bin:$PATH"
RUN python3.11 -m venv /root/venv
ENV PATH="/root/venv/bin:$PATH"

# install requirements
COPY requirements.txt .
RUN pip3 install --no-cache-dir wheel
RUN pip3 install --no-cache-dir -r requirements.txt

### Runner image
FROM lsiobase/ubuntu:jammy AS runner-image
FROM ubuntu:latest AS runner-image

# install python
RUN apt-get update && apt-get install --no-install-recommends -y python3.11 python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# use unprivileged user and virtual environment
RUN chsh -s /bin/bash abc
COPY --from=builder-image /home/abc/venv /home/abc/venv
# use virtual environment
COPY --from=builder-image /root/venv /root/venv

# create directory for runtime and switch to user
RUN mkdir -p /run
Expand All @@ -43,8 +42,8 @@ EXPOSE 443/tcp
ENV PYTHONUNBUFFERED=1

# activate virtual environment
ENV VIRTUAL_ENV=/home/abc/venv
ENV PATH="/home/abc/venv/bin:$PATH"
ENV VIRTUAL_ENV=/root/venv
ENV PATH="/root/venv/bin:$PATH"

# run server when container starts
CMD [ "python3", "./mediator.py", "--log-level", "1" ]
Expand Down

0 comments on commit 67c3086

Please sign in to comment.