Commit fb3d8b0f authored by Romain Deville's avatar Romain Deville

🐳 Containerization of COIN with docker-compose

Upgrade psycopg2 to 2.7.4 to avoid pip install error

Setup docker-compose.yaml file to run coin in container to test quickly
May need some work to be better.
parent 2e62bc71
FROM python:2
ENV PYTHONUNBUFFERED 1
RUN mkdir /src
WORKDIR /src
COPY requirements.txt /src/
# Copying code
RUN apt update
RUN apt install -y \
python-dev \
python-pip \
libldap2-dev \
libpq-dev \
libsasl2-dev \
libjpeg-dev \
libxml2-dev \
libxslt1-dev \
libffi-dev \
python-cairo \
libpango1.0-0
RUN pip install -r requirements.txt
# RUN apt install curl
DEBUG=TRUE
DATABASE_URL=postgresql://postgres@postgres:5432/postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=coin_db
POSTGRES_PORT=5432
POSTGRES_HOST=coin_db
---
version: '3'
services:
app:
build: .
image: pagoda_app
#restart: always
command: >
sh -c "python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/src
ports:
- "8000:8000"
env_file:
- docker-compose.env
depends_on:
- coin_db
- run_once
coin_db:
image: postgres:alpine
# restart: always
env_file:
- docker-compose.env
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
run_once:
build:
context: .
image: pagoda_run_once
command: >
sh -c "python manage.py makemigrations"
sh -c "python manage.py migrate"
env_file:
- docker-compose.env
volumes:
- .:/src
depends_on:
- coin_db
Django>=1.8.17,<1.9
psycopg2==2.5.4
psycopg2==2.7.4
# To match django-ldapdb version:
python-ldap>=3.0,<3.1
wsgiref==0.1.2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment