Commits (2)
# Dockerfile for Debian Contributors website backend
# http://contributors.debian.org/
#
# Copyright (C) 2015 Simó Albert i Beltran <sim6@probeta.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
FROM debian
MAINTAINER Simó Albert i Beltran
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y \
python-django \
python-ldap \
python-debiancontributors \
eatmydata \
git \
curl
COPY ./ /srv/dc/
WORKDIR /srv/dc/
# Waiting for django-housekeeping package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748875
RUN git clone https://github.com/spanezz/django-housekeeping /srv/django-housekeeping \
&& cd /srv/django-housekeeping/ \
&& python ./setup.py install
RUN cp dc/local_settings.py.devel dc/local_settings.py
RUN ./manage.py migrate
RUN curl https://contributors.debian.org/contributors/export/sources | eatmydata ./manage.py import_sources
CMD eatmydata ./manage.py runserver 0.0.0.0:8000
EXPOSE 8000
......@@ -5,6 +5,50 @@ See https://wiki.debian.org/Teams/FrontDesk/DcSiteDevel for this project's page
## Running this code on your own machine
### Docker (WIP)
You can run a Docker container:
# install docker
sudo apt-get install docker.io
# get the source code
git clone https://anonscm.debian.org/git/nm/dc.git
cd dc
# build the image
docker build -t dc .
# run container
docker run --name=debian_contributors -d -p 8000:8000 dc
Check it out at http://localhost:8000
Stop and remove the container:
docker stop debian_contributors
docker rm debian_contributors
Run with your own code:
# create configuration file, see also "Configuration" section above
cp dc/local_settings.py.devel dc/local_settings.py
editor dc/local_settings.py # edit as needed
# run container with the code of host
docker run --name=mydc -d -v $PWD:/srv/dc -p 8000:8000 dc
# create database on host filesystem, see also "First setup" section above
docker exec mydc ./manage.py migrate
Add your source at http://localhost:8000/sources/ or add some sources from contributors.debian.org, see also "Fill in data" section above:
# get the sources.json
curl -o sources.json https://contributors.debian.org/contributors/export/sources
# import it
docker exec mydc eatmydata ./manage.py import_sources sources.json
Check the sources at http://localhost:8000/sources/
Get an interactive console:
docker exec -it mydc bash
### Dependencies
apt-get install python-django python-ldap python-debiancontributors eatmydata
......