-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockercron
43 lines (30 loc) · 1.25 KB
/
Dockercron
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
# Use an official Python runtime as a parent image
FROM python:2.7
COPY . /home/bagofgold/bagogold
COPY conf/settings_prod.py /home/bagofgold/bagogold/conf/settings_local.py
# Apagar arquivos de settings
RUN rm /home/bagofgold/bagogold/conf/settings_dev.py
RUN rm /home/bagofgold/bagogold/conf/settings_prod.py
COPY conf/.pgpass /root/.pgpass
RUN chmod 0600 /root/.pgpass
RUN rm /home/bagofgold/bagogold/conf/.pgpass
# Apagar arquivos pyc
RUN find /home/bagofgold/bagogold -name "*.pyc" | xargs rm
WORKDIR /home/bagofgold/bagogold
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Preparar html e static
RUN python manage.py minificar_html
RUN python manage.py remover_static_minificado -r
RUN python manage.py preparar_aws
RUN mkdir /root/.aws
RUN mv /home/bagofgold/bagogold/credentials /root/.aws/credentials
RUN apt-get update
RUN apt-get install -y postgresql-client
RUN apt-get install nano
# Remover pastas nao utilizadas
RUN rm -rf /home/bagofgold/bagogold/apache-conf
RUN rm -rf /home/bagofgold/bagogold/backups
RUN mkdir /home/bagofgold/bagogold/backups
# Roda servidor em localhost mas deve receber comando externo
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]