forked from archesproject/arches-her
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
80 lines (65 loc) · 2.34 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM ubuntu:20.04 as base
USER root
## Setting default environment variables
ENV WEB_ROOT=/web_root
ENV APP_ROOT=${WEB_ROOT}/arches_her
# Root project folder
ENV ARCHES_ROOT=${WEB_ROOT}/arches
ENV WHEELS=/wheels
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y make software-properties-common
# Get the pre-built python wheels from the build environment
RUN mkdir ${WEB_ROOT}
# Install packages required to run Arches
# Note that the ubuntu/debian package for libgdal1-dev pulls in libgdal1i, which is built
# with everything enabled, and so, it has a huge amount of dependancies (everything that GDAL
# support, directly and indirectly pulling in mysql-common, odbc, jp2, perl! ... )
# a minimised build of GDAL could remove several hundred MB from the container layer.
RUN set -ex \
&& RUN_DEPS=" \
build-essential \
python3.8-dev \
mime-support \
libgdal-dev \
python3-venv \
postgresql-client-12 \
python3.8 \
python3.8-distutils \
python3.8-venv \
dos2unix \
git \
" \
&& apt-get install -y --no-install-recommends curl \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends $RUN_DEPS \
&& apt-get install -y nodejs \
&& npm install -g yarn
RUN apt-get install python3-pip -y
# Install Yarn components
RUN mkdir -p ${APP_ROOT}/arches_her/app/media/packages
WORKDIR ${APP_ROOT}/arches_her
RUN yarn install
WORKDIR ${WEB_ROOT}
RUN rm -rf /root/.cache/pip/*
# Install the Arches application
# FIXME: ADD from github repository instead?
COPY ./arches ${ARCHES_ROOT}
# From here, run commands from ARCHES_ROOT
WORKDIR ${ARCHES_ROOT}
RUN pip install -e . --user --no-use-pep517 && pip install -r arches/install/requirements.txt && pip install -r arches/install/requirements_dev.txt
COPY /arches_her/docker/entrypoint.sh ${WEB_ROOT}/entrypoint.sh
RUN chmod -R 700 ${WEB_ROOT}/entrypoint.sh &&\
dos2unix ${WEB_ROOT}/entrypoint.sh
RUN mkdir /var/log/supervisor
RUN mkdir /var/log/celery
RUN apt-get install python-is-python3
# Set default workdir
WORKDIR ${APP_ROOT}
# # Set entrypoint
ENTRYPOINT ["../entrypoint.sh"]
CMD ["run_arches"]
# Expose port 8000
EXPOSE 8000