Skip to content

Commit 302526f

Browse files
committed
Update of docker container to latest ubuntu LTS (24.04)
1 parent f5a8214 commit 302526f

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

exact/Dockerfile.prod

+15-6
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44

55

66
# pull official base image
7-
FROM ubuntu:22.04 as builder
7+
FROM ubuntu:24.04 AS builder
88

99
# set work directory
1010
WORKDIR /usr/src/app
1111

12-
RUN apt-get update && apt-get install -y python3-pip dos2unix\
12+
RUN apt-get update && apt-get install -y python3-pip python3-venv dos2unix\
1313
&& rm -rf /var/lib/apt/lists/*
1414

1515

1616
# set environment variables
1717
ENV PYTHONDONTWRITEBYTECODE 1
1818
ENV PYTHONUNBUFFERED 1
1919

20+
RUN python3 -m venv /opt/venv
21+
# Enable venv
22+
ENV PATH="/opt/venv/bin:$PATH"
23+
2024

2125
# lint
2226
RUN pip3 install --upgrade pip
@@ -46,14 +50,15 @@ RUN chmod +x /usr/src/app/entrypoint.prod.sh
4650
#########
4751

4852

49-
FROM ubuntu:22.04
53+
FROM ubuntu:24.04
5054

5155
# create directory for the app user
5256
RUN mkdir -p /home/app
5357

58+
RUN apt-get update && apt-get install adduser
5459
# create the app user
55-
RUN addgroup --system app --gid 1001
56-
RUN adduser --system --group app
60+
RUN /usr/sbin/addgroup --system app --gid 1001
61+
RUN /usr/sbin/adduser --system --group app
5762

5863
# create the appropriate directories
5964
ENV HOME=/home/app
@@ -66,12 +71,16 @@ WORKDIR $APP_HOME
6671

6772
ENV DEBIAN_FRONTEND="noninteractive" TZ="SystemV"
6873
# install dependencies
69-
RUN apt-get update && apt-get install -y python3-pip python3-openslide libvips libvips-dev python3-opencv netcat \
74+
RUN apt-get update && apt-get install -y python3-pip python3-venv python3-openslide libvips libvips-dev python3-opencv netcat-traditional \
7075
&& rm -rf /var/lib/apt/lists/*
7176

7277

7378
COPY --from=builder /usr/src/app/wheels /wheels
7479
COPY --from=builder /usr/src/app/requirements.txt .
80+
RUN python3 -m venv /opt/venv
81+
# Enable venv
82+
ENV PATH="/opt/venv/bin:$PATH"
83+
7584
RUN pip3 install --upgrade pip
7685
RUN pip3 install numpy==1.26.0
7786
RUN pip3 install --no-cache /wheels/*

0 commit comments

Comments
 (0)