-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (27 loc) · 1.2 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
# Use an official Python runtime as a parent image
FROM python:2.7
COPY . /home/nizbel/propostas-candidatos-bbc
COPY settings_prod.py /home/nizbel/propostas-candidatos-bbc/presidenciaveis/settings.py
# Apagar arquivos de settings
RUN rm /home/nizbel/propostas-candidatos-bbc/settings_prod.py
RUN rm -rf /home/nizbel/propostas-candidatos-bbc/.hg
# Apagar arquivos pyc
RUN find /home/nizbel/propostas-candidatos-bbc -name "*.pyc" | xargs rm
WORKDIR /home/nizbel/propostas-candidatos-bbc
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 80
# Instalar apache
RUN apt-get update
RUN apt-get install -y apache2 apache2-utils libexpat1 ssl-cert && apt-get clean
RUN apt-get install -y libapache2-mod-wsgi
WORKDIR /home/nizbel/propostas-candidatos-bbc/apache-conf
RUN . /home/nizbel/propostas-candidatos-bbc/apache-conf/set-apache.sh
WORKDIR /home/nizbel/propostas-candidatos-bbc
# Rodar collectstatic
RUN python manage.py collectstatic --noinput
# Remover pastas nao utilizadas
RUN rm -rf /home/nizbel/propostas-candidatos-bbc/apache-conf
RUN apt-get install nano
# Run app.py when the container launches
CMD apachectl -D FOREGROUND