Skip to content

Instantly share code, notes, and snippets.

@bufke
Created October 1, 2015 21:23
Show Gist options
  • Save bufke/a6a9ba076a761be13c81 to your computer and use it in GitHub Desktop.
Save bufke/a6a9ba076a761be13c81 to your computer and use it in GitHub Desktop.
GeoDjango with docker-compose
db:
image: mdillon/postgis
web:
build: .
command: ./manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
links:
- db
- redis
environment:
DATABASE_URL: postgis://postgres:postgres@db:5432/postgres
FROM python:3.4
ENV PYTHONUNBUFFERED 1
RUN apt-get update ; apt-get --assume-yes install binutils libproj-dev gdal-bin
RUN wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
RUN tar -xjf geos-3.4.2.tar.bz2
RUN cd geos-3.4.2; ./configure; make; make install
RUN wget http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz
RUN tar -xzf gdal-1.11.0.tar.gz
RUN cd gdal-1.11.0; ./configure; make; make install
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code
RUN pip install -r requirements.txt
ADD . /code/
@mortezaomidi
Copy link

mortezaomidi commented Nov 13, 2021

Thanks @bufke. I upgrade gdal, proj and geos to latest version, and it still works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment