-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
53 lines (40 loc) · 1.62 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
FROM continuumio/miniconda3
# update
RUN conda update -n base conda
# Set package installer as non-interactive
ENV DEBIAN_FRONTEND noninteractive
# Set a terminal type
ENV TERM xterm-256color
WORKDIR /app
# Install packges
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
# apache for serving the visualisation
apache2 \
# easier management of services via supervisor
supervisor \
# base anaconda image seems to lack libgl support required for our virtual environment
libgl1-mesa-glx \
# handy text editor
vim
# Setup apache & supervisor
RUN rm -rf /var/www/html && ln -s /app/reports /var/www/html
ADD conf/insight-lane.conf /etc/apache2/sites-available/insight-lane.conf
RUN ln -s /etc/apache2/sites-available/insight-lane.conf /etc/apache2/sites-enabled/insight-lane.conf
RUN a2enmod rewrite
ADD conf/supervisord.conf /etc/supervisord.conf
# Make sure processes are stopped
RUN service apache2 stop && service supervisor stop
# Entrypoint script that will kick off supervisor (which in turn starts apache)
ADD conf/start.sh /start.sh
RUN chmod +x /start.sh
# Setup the project's virtual environment
COPY conda-linux-64.lock /app/conda-linux-64.lock
RUN ["conda", "create", "--name", "crash-model", "--file", "conda-linux-64.lock"]
# Use bash for the entrypoint rather than sh, for 'conda activate' compatibility
ENTRYPOINT ["/bin/bash", "-c"]
# Activate the project's virtual environment
RUN echo "conda activate crash-model" >> ~/.bashrc
# this startup script runs supervisor in foreground (which in turn starts apache) to keep container running
CMD ["/start.sh"]
# Make the apache port available
EXPOSE 8080