-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (38 loc) · 1.76 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
# This Dockerfile builds the container for this web application
# Author: Manuel Bernal Llinares <[email protected]>
FROM debian:stable-slim
LABEL maintainer="Manuel Bernal Llinares <[email protected]>"
# Environment - Defaults
ENV FOLDER_BASE /home/webapp
ENV FOLDER_NAME_SITE site
ENV FOLDER_WEBSITE_ROOT ${FOLDER_BASE}/${FOLDER_NAME_SITE}
ENV DJANGO_SETTINGS_MODULE projectweb.settings.production
ENV DJANGO_ALLOWED_HOSTS identifiers.org,cloud.identifiers.org,cloud.aws.identifiers.org,cloud.gcloud.identifiers.org
ENV DJANGO_STATIC_ROOT ${FOLDER_WEBSITE_ROOT}/static
ENV SITE_CNAME identifiers.org cloud.identifiers.org cloud.aws.identifiers.org cloud.gcloud.identifiers.org
ENV PROXY_PASS_INFORMATION unix:/tmp/webapp.socket
ENV GUNICORN_WSGI_APPLICATION projectweb.wsgi:application
ENV WEB_CONFIG_SERVICE_RESOLVER_HOST resolver
ENV WEB_CONFIG_SERVICE_RESOLVER_PORT 8080
ENV WEB_CONFIG_SERVICE_REGISTRY_HOST registry
ENV WEB_CONFIG_SERVICE_REGISTRY_PORT 8081
# Site folder
RUN mkdir -p ${FOLDER_BASE}
# Install Application REQUIREMENTS
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y python3 python3-pip git nginx && \
cd ${FOLDER_BASE} && \
git clone https://github.com/identifiers-org/cloud-web-frontend.git ${FOLDER_NAME_SITE} && \
pip3 install --no-cache-dir pipreqs nose && \
pip3 install --no-cache-dir -r ${FOLDER_WEBSITE_ROOT}/requirements.txt && \
pip3 install --no-cache-dir gunicorn && \
rm /etc/nginx/sites-enabled/default && \
ln -s ${FOLDER_WEBSITE_ROOT}/deployment/nginx.site /etc/nginx/sites-enabled/site && \
mkdir -p ${DJANGO_STATIC_ROOT} && \
cd ${FOLDER_WEBSITE_ROOT} && \
python3 manage.py collectstatic --noinput
# Launch information
EXPOSE 9090
WORKDIR /home/webapp/site
CMD deployment/startcontainer.sh