Browse Source

dockerize for develomment

pull/73/head
Till Kahlbrock 8 years ago
parent
commit
c1f07c3f3a
6 changed files with 65 additions and 0 deletions
  1. +17
    -0
      Dockerfile
  2. +18
    -0
      README.md
  3. +14
    -0
      docker-compose.yaml
  4. +7
    -0
      entrypoint
  5. +8
    -0
      stuff/development/entrypoint-tests
  6. +1
    -0
      stuff/development/requirements_dev.txt

+ 17
- 0
Dockerfile View File

@ -0,0 +1,17 @@
FROM python:3
RUN mkdir /app
COPY hc /app/hc
COPY static /app/static
COPY stuff /app/stuff
COPY templates /app/templates
COPY manage.py /app/manage.py
COPY requirements.txt /app/requirements.txt
COPY entrypoint /app/entrypoint
RUN chmod +x /app/entrypoint
WORKDIR /app
RUN ["pip", "install", "-r", "requirements.txt"]

+ 18
- 0
README.md View File

@ -67,6 +67,24 @@ The site should now be running at `http://localhost:8080`
To log into Django administration site as a super user,
visit `http://localhost:8080/admin`
## Setting Up for Development using Docker
You need to have [Docker](https://docs.docker.com/engine/installation/) and
[Docker Compose](https://docs.docker.com/compose/install/) installed.
* check out project code:
$ git clone https://github.com/healthchecks/healthchecks.git
$ cd healthchecks
* run the tests:
$ docker-compose run tests
* run development server:
$ docker-compose up server
## Database Configuration
Database configuration is stored in `hc/settings.py` and can be overriden


+ 14
- 0
docker-compose.yaml View File

@ -0,0 +1,14 @@
---
server:
build: .
ports:
- 8080:80
volumes:
- .:/app
command: /app/entrypoint
tests:
build: .
volumes:
- .:/app
command: /app/stuff/development/entrypoint-tests

+ 7
- 0
entrypoint View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -ex
python manage.py migrate
python manage.py ensuretriggers
python manage.py runserver 0.0.0.0:80

+ 8
- 0
stuff/development/entrypoint-tests View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -ex
python manage.py migrate
python manage.py ensuretriggers
pip install -r /app/stuff/development/requirements_dev.txt
python /app/manage.py test hc/api/tests

+ 1
- 0
stuff/development/requirements_dev.txt View File

@ -0,0 +1 @@
mock-2.0.0

Loading…
Cancel
Save