Skip to content

Commit 8432f44

Browse files
authored
Merge pull request #106 from Geode-solutions/feat/lighter_docker_image
Feat/lighter docker image
2 parents 70e9b9e + 4e13c5a commit 8432f44

2 files changed

Lines changed: 27 additions & 10 deletions

File tree

Dockerfile

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
1-
FROM python:3.12-slim
1+
FROM python:3.12-slim-bookworm AS builder
22

3-
WORKDIR /server
3+
RUN apt-get update && apt-get install -y binutils
4+
5+
WORKDIR /app
46

57
COPY . .
6-
RUN pip3 install . && \
7-
apt-get update && \
8-
apt-get install -y libgomp1 && \
9-
apt-get install -y curl && \
10-
apt-get update && apt-get install -y wget
8+
RUN pip3 install --no-cache-dir . pyinstaller
9+
10+
RUN pyinstaller \
11+
--onefile \
12+
--collect-data opengeodeweb_back \
13+
--collect-data vease_back \
14+
--recursive-copy-metadata vease_back src/vease_back/app.py \
15+
--distpath dist \
16+
--name vease-back \
17+
--clean
18+
ENV PYTHON_ENV="prod"
19+
20+
FROM debian:12-slim
21+
22+
COPY --from=builder /app/dist/vease-back /usr/local/bin/vease-back
23+
RUN chmod +x /usr/local/bin/vease-back
24+
25+
EXPOSE 5000
26+
ENV PYTHON_ENV=prod
1127

12-
CMD ["vease-back", "--data_folder_path", "/data", "--allowed_origins", "['https://next.vease.geode-solutions.com', 'https://vease.geode-solutions.com']" , "--timeout", "5"]
28+
ENTRYPOINT ["/usr/local/bin/vease-back"]
29+
CMD ["--data_folder_path", "/data", \
30+
"--allowed_origins", "['https://next.vease.geode-solutions.com', 'https://vease.geode-solutions.com']", \
31+
"--timeout", "5"]
1332

14-
EXPOSE 5000

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
# pip-compile --output-file=./requirements.txt ./requirements.in
66
#
77

8-
opengeodeweb-back==5.*,>=5.14.0

0 commit comments

Comments
 (0)