-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (25 loc) · 888 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# syntax=docker/dockerfile:1
# build:
# docker buildx build -t edriso -f Dockerfile .
# run:
# docker run -it --rm --publish 5000:5000 edriso --bind_host 0.0.0.0
FROM ubuntu:24.04
# Create user with home dir
RUN useradd --create-home nonroot
# Install python and libeccodes-dev. Create /data.
RUN apt-get update && \
apt-get install -y --no-install-recommends python3-dev python3-pip \
python3-venv libeccodes-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Set workdir and install app with requirements.
WORKDIR /app
COPY app/ ./app/
COPY favicon.ico requirements.txt ./
RUN python3 -m venv ./venv && \
./venv/bin/pip install -r ./requirements.txt
# Create data dir
RUN mkdir /app/data && chown -R nonroot:nonroot /app/data
# Run as nonroot user
USER nonroot
EXPOSE 5000
ENTRYPOINT ["/app/venv/bin/python", "/app/app/app.py", "--bind_host", "0.0.0.0"]