-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (62 loc) · 2.29 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
FROM ubuntu:20.04 as base
USER root
## Setting default environment variables
ENV WEB_ROOT=/web_root
ENV APP_ROOT=${WEB_ROOT}/accessibility
# 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_16.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
RUN apt install python3-pip -y && apt-get install -y nodejs && npm install -g yarn
# Install Yarn components
# RUN mkdir -p ${APP_ROOT}/accessibility/app/media/packages
WORKDIR ${APP_ROOT}/accessibility
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 && pip install -r arches/install/requirements.txt && pip install -r arches/install/requirements_dev.txt
COPY /accessibility/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
# Set default workdir
WORKDIR ${APP_ROOT}
# # Set entrypoint
ENTRYPOINT ["../entrypoint.sh"]
CMD ["run_arches"]
# Expose port 8000
EXPOSE 8000