Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Api

SuperBeer backend that is linked to a postgresql container with the spatial database extender postGIS.

Setup

Api Dockerfile is used to deploy the django api on port 8000. Use django 1.7.1-python2 official image.

Dependencies :

python 2.7

django 1.7.1

With Vagrant

Create the virtualmachine for api dev and provision with postgis docker

vagrant up

Enter the VM

vagrant ssh

Look for the docker IP

ifconfig

Set the IP in your variable

POSTGIS_PORT_5432_TCP_ADDR=<the_postgis_docker_IP>
export POSTGIS_PORT_5432_TCP_ADDR

Run your django entity

cd workspace/
./manage.py runserver 0.0.0.0:8000

Info

Admin panel

link :
http://ns395300.ip-176-31-120.eu:8000/admin/

Api doc

link :
http://ns395300.ip-176-31-120.eu:8000/api/doc/

Test

http://ns395300.ip-176-31-120.eu:8000/api/v1/top5/?format=json&coord={%22type%22:%20%22Point%22,%20%22coordinates%22:%20[6.139835,%2046.194075]}

Issue when installing on kimsufi server

#!console

lola@ns395300:~/Beer/docker/postgres$ sudo docker build -t beer/geodjango-postrgres .
Sending build context to Docker daemon 11.26 kB
Sending build context to Docker daemon 
Step 0 : FROM ubuntu:14.04
Pulling repository ubuntu
2015/01/18 18:00:34 Get https://index.docker.io/v1/repositories/ubuntu/images: dial tcp: lookup index.docker.io: no DNS servers

SOLVE !

Modifying /etc/resolv.conf seems to do the trick:

#!console

nano /etc/resolv.conf

--------
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 8.8.8.8

Then restart Docker but be carefull there is two verion of docker : docker and docker.io.
When installing docker.io do

#!console

sudo restart docker.io

OK not solve yet.
Because OVH has a fucking custom kernel we need to switch kernel but following this tuto has done the trick:

http://www.sysadminworld.com/2012/how-to-switch-to-the-standard-ubuntu-kernel-on-ovh/

Docker Pull Command
Owner
superbeer
Source Repository