Last active
December 15, 2017 21:21
-
-
Save meganlkm/1df291c2941656288a0bb4b318dbbe91 to your computer and use it in GitHub Desktop.
simple django/mezzanine example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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