-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
57 lines (34 loc) · 1.61 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM ubuntu:20.04 AS builder
#FROM laurielias/python-3.8.10-dlib:latest AS builder
ENV DEBIAN_FRONTEND noninteractive
MAINTAINER Lauri Elias <[email protected]>
RUN apt-get --allow-releaseinfo-change update
RUN apt-get update && \
apt-get install -y gdal-bin libgdal-dev python3-gdal proj-bin libproj-dev python3-pip libdlib-dev cmake
ENV CPLUS_INCLUDE_PATH /usr/include/gdal/
ENV C_INCLUDE_PATH /usr/include/gdal/
WORKDIR /home/docker/ajapaik
COPY requirements.txt .
RUN pip3 install --upgrade pip && \
pip3 wheel --wheel-dir=./wheels/ uwsgi && \
pip3 wheel --wheel-dir=./wheels/ -r requirements.txt
# Lightweight deployment image this time
FROM python:3.8.10-slim AS deployer
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends netcat ffmpeg libxext6 uwsgi python3-opencv binutils libproj-dev gdal-bin libglib2.0-0 libsm6 \
libxrender-dev gettext procps libgdal-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home/docker/ajapaik
COPY --from=builder /home/docker/ajapaik/wheels ./wheels
COPY requirements.txt wsgi.py manage.py ./
RUN pip3 install --no-index --find-links=./wheels uwsgi -r requirements.txt && rm -rf ./wheels \
&& rm -rf requirements.txt && rm -rf ajapaik/tests && rm -rf ajapaik/ajapaik/tests
COPY ajapaik ./ajapaik
COPY templates ./templates
COPY docker/uwsgi.ini ./docker/uwsgi.ini
COPY docker/solr ./docker/solr
COPY docker/docker-entrypoint.sh docker/docker-entrypoint-dev.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint-dev.sh
EXPOSE 8000
ENTRYPOINT ["docker-entrypoint.sh"]