forked from FNNDSC/ChRIS_ultron_backEnd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_dev
executable file
·61 lines (54 loc) · 2.32 KB
/
Dockerfile_dev
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
#
# Docker file for ChRIS development server
#
# Build with
#
# docker build -t <name>:<tag> -f <dockerfile> .
#
# For example if building a local version, you could do:
#
# docker build -t local/chris:dev -f Dockerfile_dev .
#
# In the case of a proxy (located at say proxy.tch.harvard.edu:3128), do:
#
# export PROXY="http://proxy.tch.harvard.edu:3128"
# docker build --build-arg http_proxy=${PROXY} --build-arg UID=$UID -t local/chris:dev -f Dockerfile_dev .
#
# To run an interactive shell inside this container, do:
#
# docker run -ti --entrypoint /bin/bash local/chris:dev
#
# To pass an env var HOST_IP to container, do:
#
# docker run -ti -e HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}') --entrypoint /bin/bash local/chris:dev
#
FROM fnndsc/ubuntu-python3:latest
MAINTAINER fnndsc "[email protected]"
# Pass a UID on build command line (see above) to set internal UID
ARG UID=1001
ENV UID=$UID DEBIAN_FRONTEND=noninteractive VERSION="0.1"
ENV APPROOT="/home/localuser/chris_backend" REQPATH="/usr/src/requirements"
COPY ["./requirements", "${REQPATH}"]
COPY ["./docker-entrypoint_dev.sh", "/usr/src"]
RUN apt-get update \
&& apt-get install -y locales \
&& export LANGUAGE=en_US.UTF-8 \
&& export LANG=en_US.UTF-8 \
&& export LC_ALL=en_US.UTF-8 \
&& locale-gen en_US.UTF-8 \
&& dpkg-reconfigure locales \
&& apt-get install sudo \
&& apt-get install -y libmysqlclient-dev \
&& apt-get install -y libssl-dev libcurl4-openssl-dev \
&& apt-get install -y apache2 apache2-dev \
&& apt-get install -y bsdmainutils vim net-tools inetutils-ping \
&& pip install -r ${REQPATH}/local.txt \
&& useradd -u $UID -ms /bin/bash localuser \
&& echo "localuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Start as user localuser
USER localuser
WORKDIR $APPROOT
ENTRYPOINT ["/usr/src/docker-entrypoint_dev.sh"]
EXPOSE 8000
# Start ChRIS development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]