1
- FROM python:3.7-alpine
2
-
3
- # Thanks to http://www.sandtable.com/reduce-docker-image-sizes-using-alpine
4
- # FROM debian:jessie
1
+ FROM ubuntu:jammy
5
2
6
3
# Credits to yjacolin for providing first versions
7
4
LABEL original_developer=
"yjacolin <[email protected] >" \
10
7
# These are default values,
11
8
# Override when running container via docker(-compose)
12
9
10
+ # ARGS
11
+ ARG TZ="Etc/UTC"
12
+ ARG LANG="en_US.UTF-8"
13
+ ARG ADD_DEB_PACKAGES=""
14
+
13
15
# General ENV settings
14
16
ENV LC_ALL="en_US.UTF-8" \
15
17
LANG="en_US.UTF-8" \
16
18
LANGUAGE="en_US.UTF-8" \
17
19
\
18
20
\
21
+ DEB_PACKAGES="locales gunicorn python3-gunicorn python3-gevent python3-psycopg2 python3-lxml python3-pyproj" \
22
+ DEB_BUILD_DEPS="make python3-pip" \
19
23
# GHC ENV settings\
20
24
ADMIN_NAME=admin \
21
25
ADMIN_PWD=admin \
@@ -57,7 +61,7 @@ HOST=0.0.0.0 \
57
61
PORT=80 \
58
62
WSGI_WORKERS=4 \
59
63
WSGI_WORKER_TIMEOUT=6000 \
60
- WSGI_WORKER_CLASS='eventlet ' \
64
+ WSGI_WORKER_CLASS='gevent ' \
61
65
\
62
66
# GHC Core Plugins modules and/or classes, seldom needed to set: \
63
67
# if not specified here or in Container environment \
@@ -69,9 +73,12 @@ WSGI_WORKER_CLASS='eventlet' \
69
73
# GHC User Plugins, best be overridden via Container environment \
70
74
GHC_USER_PLUGINS=''
71
75
72
- RUN apk add --no-cache --virtual .build-deps gcc build-base libxslt-dev libxml2-dev linux-headers postgresql-dev \
73
- && apk add --no-cache bash postgresql-client libxslt libxml2 tzdata openntpd proj-dev proj-util \
74
- && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
76
+ # Install operating system dependencies
77
+ RUN \
78
+ apt-get update \
79
+ && apt-get --no-install-recommends install -y ${DEB_PACKAGES} ${DEB_BUILD_DEPS} ${ADD_DEB_PACKAGES} \
80
+ && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
81
+ && echo "For ${TZ} date=$(date)" && echo "Locale=$(locale)"
75
82
76
83
# Add standard files and Add/override Plugins
77
84
# Alternative Entrypoints to run GHC jobs
@@ -81,8 +88,15 @@ COPY docker/scripts/*.sh docker/config_site.py docker/plugins /
81
88
# Add Source Code
82
89
COPY . /GeoHealthCheck
83
90
84
- # Install and Remove build-related packages for smaller image size
85
- RUN chmod a+x /*.sh && bash install.sh && apk del .build-deps
91
+ # Install
92
+ RUN \
93
+ chmod a+x /*.sh && ./install.sh \
94
+ # Cleanup TODO: remove unused Locales and TZs
95
+ && apt-get remove --purge -y ${DEB_BUILD_DEPS} \
96
+ && apt-get clean \
97
+ && apt autoremove -y \
98
+ && rm -rf /var/lib/apt/lists/*
99
+
86
100
87
101
# For SQLite
88
102
VOLUME ["/GeoHealthCheck/DB/" ]
0 commit comments