-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (35 loc) · 1.25 KB
/
Dockerfile
File metadata and controls
46 lines (35 loc) · 1.25 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
FROM python:3.13-slim
# Avoid .pyc bytecode and ensure output is unbuffered for CLI responsiveness
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONOPTIMIZE=2
# Add user's local bin directory to PATH for pip installed packages
ENV PATH="/home/geotribuser/.local/bin:$PATH"
# Set locale to French UTF-8
RUN apt update && \
apt install -y --no-install-recommends locales && \
echo "fr_FR.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
ENV LANG=fr_FR.UTF-8 \
LANGUAGE=fr_FR:fr \
LC_ALL=fr_FR.UTF-8
# Create non-root group and user dedicated to geotribu usage
RUN groupadd --system geotribu && \
useradd -m -s /bin/bash -g geotribu geotribuser
USER geotribuser
# Set working directory and proper permissions
WORKDIR /home/geotribuser
# Custom CLI settings
ENV GEOTRIBU_CACHE_EXPIRATION_HOURS=240 \
GEOTRIBU_COMMENTS_EXPIRATION_HOURS=240 \
GEOTRIBU_RESULTATS_FORMAT=table \
GEOTRIBU_RESULTATS_NOMBRE=20
COPY --chown=geotribuser:geotribu . .
RUN pip install --no-cache-dir .[all] \
&& rm -rf ~/.cache/pip \
&& geotribu sc --no-prompt "qgis" \
&& geotribu si --no-prompt "qgis" \
&& geotribu comments latest
ENTRYPOINT ["geotribu"]
CMD []