Skip to content

Commit

Permalink
Merge pull request #381 from PyAr/docker_compose
Browse files Browse the repository at this point in the history
fix docker-compose config
Voy a crear un issue para lo que falta, así queda registrado
  • Loading branch information
cmdelatorre authored Mar 26, 2017
2 parents 05ff056 + d57bbb0 commit 3824cb9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 145 deletions.
31 changes: 19 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
FROM python:3.4-wheezy
FROM python:3.4
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /code:$PYTHONPATH
# runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*

VOLUME ["/opt/code"]

RUN apt-get update && apt-get install -y apt-utils cmake gcc make tk-dev libjpeg-dev zlib1g-dev libtiff5-dev libfreetype6-dev liblcms2-dev libwebp-dev libtk-img-doc libopenjpeg-dev

ADD ./scripts/install-openjpeg.sh /tmp/
RUN /tmp/install-openjpeg.sh

COPY ./scripts/webcli.py /webcli

CMD [ "/bin/bash" ]
EXPOSE 8000
RUN mkdir /code
WORKDIR /code
# update pip (to use wheels)
RUN wget -O - https://bootstrap.pypa.io/get-pip.py | python3
COPY dev_requirements.txt /code
COPY requirements.txt /code
RUN pip install -r dev_requirements.txt
COPY . /code/
42 changes: 19 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,31 @@ version: '2'

volumes:
pgdata:
redisdata:

services:
web:
build: .
command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
env_file: .env
links:
- postgres
- redis

postgres:
restart: always
image: postgres:latest
image: postgres:9.4.4
ports:
- "5432:5433"
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data/
environment:
- POSTGRES_PASSWORD=secret

redis:
restart: always
image: redis:latest
ports:
- "6379:6379"
web:
build: .
command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- redisdata:/data


- .:/code
ports:
- "8000:8000"
links:
- postgres
depends_on:
- postgres
environment:
- DB_USER=postgres
- DB_NAME=postgres
- DB_PASS=secret
- DB_SERVICE=postgres
2 changes: 1 addition & 1 deletion initialize.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
python3 manage.py migrate
python3 manage.py loaddata fixtures/initial_data.json
python3 manage.py createsuperuser
2 changes: 1 addition & 1 deletion pyarweb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Sites framework
SITE_ID = 1

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']

# Django registration
# https://django-registration.readthedocs.org/en/latest/quickstart.html
Expand Down
32 changes: 0 additions & 32 deletions scripts/install-openjpeg.sh

This file was deleted.

76 changes: 0 additions & 76 deletions scripts/webcli.py

This file was deleted.

0 comments on commit 3824cb9

Please sign in to comment.