Sign inSign up

turistforeningen/sherpa

By turistforeningen

Updated almost 8 years ago

The django-based website and CMS for the Norwegian Trekking Association (DNT)

Artifact
Image
0

100K+

turistforeningen/sherpa repository overview

Sherpa

Requirements Status

The django-based website and CMS for the Norwegian Trekking Association (DNT).

Requirements

  • Docker
  • Docker Compose

Configuration

Set the DJANGO_CONFIGURATION environment variable to one of prod, staging or dev. See sherpa/settings.py for more details.

Environment variables

All other variables are optional, and related features will fail if left undefined. For a complete list of variables, do something like grep -r "os.environ" sherpa/conf/.

Local overrides

To apply private settings that don't belong in the shared dev module, copy sherpa/conf/private.sample.py to sherpa/conf/private.py and define your personal settings there. The new file is ignored by git.

Installation

git clone [email protected]:Turistforeningen/sherpa.git
cd sherpa
git submodule update --init --recursive
Secret settings

Sherpa stores all secret settings in a git submodule. Note that you need access to retrieve these data. To ensure the correct revision of secret settings is checked out when you change your current branch, apply these git hooks:

cp util/git_hooks/post-checkout .git/hooks/
cp util/git_hooks/post-merge .git/hooks/
Initialize with Docker Compose

These commands may take some time complete.

docker-compose pull
docker-compose build --pull

# Import the database
docker-compose run --rm psql ./import.sh

# Install builder dependencies
docker-compose run --rm builder npm install
docker-compose run --rm builder npm run grunt:build

# Start up nginx, gunicorn, postgres and builder
docker-compose up -d
docker-compose logs [sherpa]
Set up reverse proxy

Recommended: Use Turistforeningen/docker-proxy.

Alternatively, to match the production setup, use haproxy from sherpa-prod:

git clone [email protected]:Turistforeningen/sherpa-prod.git
cd sherpa-prod
git submodule update --init --recursive
docker-compose build haproxy
docker-compose create haproxy
docker-compose start haproxy

# Configure haproxy's backend to the running nginx container
HAPROXY_CONTAINER=$(docker-compose ps -q haproxy)
cd ../sherpa
PORT=$(docker-compose port www 8080 | sed "s/0.0.0.0://")
docker exec -it ${HAPROXY_CONTAINER} ./route-backend.sh ${PORT}
Configure a local hostname

Choose the hostname for your development site. local.dnt.no is a good name because it's not likely to be used in production, and conforms to the SSL CN.

Point 127.0.0.1 to that name in /etc/hosts, then from the sherpa directory, edit the domain name for the main site accordingly:

docker-compose run --rm sherpa ./manage.py sitedomain www.dnt.no local.dnt.no

You may now access https://local.dnt.no in your browser.

Testing

make test

Tag summary

Content type

Image

Digest

Size

192.4 MB

Last updated

almost 8 years ago

docker pull turistforeningen/sherpa:www-9ec1b9a2f