Skip to content

Instantly share code, notes, and snippets.

@linneudm
Created November 13, 2019 13:10
Show Gist options
  • Save linneudm/668298ccd7da071483122adca49a0317 to your computer and use it in GitHub Desktop.
Save linneudm/668298ccd7da071483122adca49a0317 to your computer and use it in GitHub Desktop.
version: '3'
volumes:
mydb:
networks:
nginx:
db:
services:
nginx:
image: nginx:latest
container_name: nginx_app2
networks:
- nginx
ports:
- "8000:8000"
volumes:
- ./src:/code
- ./config/nginx:/etc/nginx/conf.d
depends_on:
- web
restart: always
web:
restart: always
build: .
container_name: django_app2
command: bash -c "python manage.py makemigrations && python manage.py migrate --noinput && python manage.py collectstatic --noinput && gunicorn gpsauto.wsgi:application -b 0.0.0.0:8000 --timeout 120 --workers 3 --log-level=info"
networks:
- nginx
- db
volumes:
- ./src:/code
- ./logs:/logs
expose:
- "8000"
depends_on:
- db
env_file:
- .env
db:
image: postgres:latest
container_name: postgres_app
volumes:
- mydb:/var/lib/postgresql/data
networks:
- db
ports:
- 5433:5432
redis:
image: "redis:alpine"
container_name: redis_app
expose:
- "6379"
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
#faz as configuracoes do servidor
ENV TZ=Brazil/East
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y locales
RUN sed -i -e 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
ENV LANG pt_BR.UTF-8
ENV LANGUAGE pt_BR:pt
ENV LC_ALL pt_BR.UTF-8
#ADD ./src/ /code/
# INSTALA O LIBRE OFFICE, NECESSARIO PARA CONVERSAO DOCX -> PDF
RUN apt-get install -y build-essential libssl-dev libffi-dev python-dev
RUN apt-get install -y libreoffice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment