-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (34 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
39 lines (34 loc) · 1.21 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
FROM python:3.12-slim
LABEL description="CanarieAPI: Self describing REST service for Canarie registry."
LABEL maintainer="David Byrns <david.byrns@crim.ca>, Francis Charette-Migneault <francis.charette-migneault@crim.ca>"
LABEL vendor="Ouranosinc, CRIM"
LABEL version="1.1.0"
ENV PKG_DIR=/opt/local/src/CanarieAPI
WORKDIR ${PKG_DIR}
# Add logparser cron job in the cron directory
ADD docker/canarieapi-cron /etc/cron.d/canarieapi-cron
RUN chmod 0644 /etc/cron.d/canarieapi-cron
# Install dependencies
COPY canarieapi/__init__.py canarieapi/__meta__.py ${PKG_DIR}/canarieapi/
COPY requirements.txt setup.* README.rst CHANGES.rst ${PKG_DIR}/
RUN apt-get update \
&& apt-get install -y \
build-essential \
cron \
sqlite3 \
&& pip install --no-cache-dir --upgrade pip setuptools gunicorn gevent \
&& pip install --no-cache-dir --upgrade -r ${PKG_DIR}/requirements.txt \
&& pip install --no-cache-dir -e ${PKG_DIR}
# Install package
COPY ./ ${PKG_DIR}/
RUN pip install --no-dependencies ${PKG_DIR}
# start gunicorn
CMD [ \
"gunicorn", \
"-b", "0.0.0.0:2000", \
"--workers", "1", \
"--log-level", "DEBUG", \
"--timeout", "30", \
"-k", "gevent", \
"canarieapi.wsgi" \
]