Skip to content

Instantly share code, notes, and snippets.

@meganlkm
Last active December 15, 2017 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meganlkm/1df291c2941656288a0bb4b318dbbe91 to your computer and use it in GitHub Desktop.
Save meganlkm/1df291c2941656288a0bb4b318dbbe91 to your computer and use it in GitHub Desktop.
simple django/mezzanine example
# Build it:
# docker build -t mezzanine-dev .
# Run it:
# docker run -it --rm -p '8000:8000' mezzanine-dev
# then go to http://localhost:8000/admin/
# username: admin
# password: default
FROM python
ARG project_name=foobar
RUN pip install mezzanine &&\
cd /opt &&\
mezzanine-project $project_name &&\
cd $project_name &&\
sed -i 's/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = ["*"]/' $project_name/settings.py &&\
python manage.py createdb --noinput
EXPOSE 8000
WORKDIR /opt/$project_name
VOLUME ["/opt/$project_name"]
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment