ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 627 forks source link

Master py3 docker 00 #867

Open martin-bts opened 3 years ago

martin-bts commented 3 years ago

This is essentially how I have been building and running dockerized Askbot for the past year.

Askbot has a few dependencies which require a compiler, so I moved to a two-staged build, where the first stage builds all required packages, so that the second stage merely installs whl-files and does not need a build environment.

The main image is built in three steps:

  1. Install Askbot using the whl-files from the previous stage.
  2. Create a new Django project for Askbot. This is more or less hard-coded, without using askbot/deployment.
  3. Configure the base image to serve the newly created Django Askbot project.

For a first glimpse, one should be able to simply

docker build -t askbot:latest .
docker run --rm -it -p 8000:8000 askbot:latest

For best results, #864 is applied first. I moved to Python 3.8 a few months ago, but I know 3.7 works just as well. For options see commit message of 8a3f5f3