Update Dockerfile and docker-compose.yml

Install missing dependencies
This commit is contained in:
Jezrien Hsieh 2019-03-15 03:18:48 +08:00
parent 88ae667245
commit 5dcf327673
4 changed files with 18 additions and 13 deletions

View file

@ -3,10 +3,15 @@ FROM python:3.6
WORKDIR /app
# Intall dependencies
COPY requirements.txt /app/
COPY . /app/
COPY . /app
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt update && \
apt install -y git ruby-dev nodejs && \
gem install compass sass && \
npm -g install less && \
pip install -r requirements.txt && \
pip install redis coveralls
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
ENTRYPOINT ["/app/entrypoint.sh"]

View file

@ -77,8 +77,8 @@ DATABASES = {
'NAME': 'dj_crm',
'USER': 'postgres',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
'PORT': '5432'
'HOST': os.getenv('DB_HOST', '127.0.0.1'),
'PORT': os.getenv('DB_PORT', '5432')
}
}

View file

@ -3,8 +3,8 @@ version: '2.0'
services:
db:
image: postgres
volumes:
- /home/db:/var/lib/postgresql/data
# volumes:
# - /home/db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: "root"
POSTGRES_USER: "postgres"
@ -13,7 +13,10 @@ services:
web:
build: .
image: micropyramid/django-crm:1
environment:
DB_HOST: db
DB_PORT: 5432
ports:
- "8001:8000"
depends_on:
- db
- db

View file

@ -1,9 +1,6 @@
#!/bin/bash
# Install dependencies
pip install -r requirements.txt
# Execute startup scripts
python manage.py collectstatic --noinput
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
python manage.py runserver 0.0.0.0:8000