Skip to content

Commit 1fdd0ce

Browse files
Update dependencies
Incl. Ubuntu 22.04 + Python 3.10.6
1 parent 4c1541c commit 1fdd0ce

File tree

5 files changed

+281
-184
lines changed

5 files changed

+281
-184
lines changed

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
python 3.10.5
2-
poetry 1.1.13
1+
python 3.10.6
2+
poetry 1.1.14

Dockerfile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# using ubuntu LTS version
2-
FROM ubuntu:20.04 AS builder-image
2+
FROM ubuntu:22.04 AS builder-image
33

44
# avoid stuck build due to user prompt
55
ARG DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt-get update \
8-
&& apt-get install \
7+
RUN apt-get -qq update \
8+
&& apt-get -qq install \
99
--no-install-recommends -y \
1010
aptitude \
1111
autoconf \
@@ -15,6 +15,7 @@ RUN apt-get update \
1515
curl \
1616
git \
1717
locales \
18+
libbz2-dev \
1819
libffi-dev \
1920
libncurses-dev \
2021
libreadline-dev \
@@ -46,8 +47,8 @@ RUN bash -c "git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf
4647
&& echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc \
4748
&& echo '. $HOME/.asdf/asdf.sh' >> $HOME/.profile"
4849
RUN asdf plugin-add python \
49-
&& asdf install python 3.10.5 \
50-
&& asdf global python 3.10.5
50+
&& asdf install python 3.10.6 \
51+
&& asdf global python 3.10.6
5152

5253
ENV POETRY_HOME="$HOME/.poetry"
5354
RUN curl -sSL https://install.python-poetry.org | python3.10 -
@@ -60,15 +61,18 @@ RUN python3.10 -m venv /opt/venv
6061
# Install pip requirements
6162
RUN . /opt/venv/bin/activate && poetry install
6263

63-
FROM ubuntu:20.04 AS runner-image
64+
# TODO: dive + docker-slim
65+
FROM ubuntu:22.04 AS runner-image
6466

6567
ARG USERNAME=appuser
6668
ENV HOME="/home/${USERNAME}"
6769
ENV VIRTUAL_ENV="/opt/venv"
68-
ENV PATH="${VIRTUAL_ENV}/bin:$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
70+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
71+
ENV PATH="${VIRTUAL_ENV}/bin:$HOME/.asdf/bin:$HOME/.asdf/shims:/ms-playwright:$PATH"
6972

7073
RUN useradd --create-home $USERNAME \
71-
&& mkdir -p /home/${USERNAME}/app
74+
&& mkdir -p /home/${USERNAME}/app \
75+
&& mkdir -p $PLAYWRIGHT_BROWSERS_PATH
7276

7377
COPY --chown=${USERNAME}:${USERNAME} . $HOME/app
7478
COPY --from=builder-image --chown=${USERNAME}:${USERNAME} /opt/venv /opt/venv
@@ -77,8 +81,8 @@ COPY --from=builder-image --chown=${USERNAME}:${USERNAME} $HOME/.asdf $HOME/.asd
7781
# avoid stuck build due to user prompt
7882
ARG DEBIAN_FRONTEND=noninteractive
7983

80-
RUN apt-get update \
81-
&& apt-get install \
84+
RUN apt-get -qq update \
85+
&& apt-get -qq install \
8286
--no-install-recommends -y \
8387
ca-certificates \
8488
curl \
@@ -99,4 +103,5 @@ USER appuser
99103
WORKDIR $HOME/app
100104

101105
ENTRYPOINT ["python", "hello.py"]
106+
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]
102107
# CMD ["/bin/bash"]

0 commit comments

Comments
 (0)