Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:2.7
RUN apt update
RUN apt upgrade -y
RUN apt install vim -y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you combine this?
RUN apt update && apt upgrade -y && apt clean

And why vim?

RUN mkdir /sabot
WORKDIR /sabot
ADD . /sabot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you resort this, this could save some layers:
ADD . /sabot WORKDIR /sabot

RUN pip install -r requirements.txt
EXPOSE 8000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there no ENTRYPOINT or CMD in here? bash in a container is not how containers should be used

21 changes: 21 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,24 @@ If you want to use the invoice creation functionality, it is required that
you have libreoffice (or openoffice) installed on the server.

Here is a pretty good tutorial to run django apps with guniocorn behind an apache webserver: https://wiki.uberspace.de/cool:django (easy to adopt for SaBoT)

## Docker Setup

You can also run the server instance inside a Docker container

- create the following config files:
- sabot/settings.py
- sabot/conferenceSettings.py
- sabot/localSettings.py (and sabot/prodSettings.py if you want to distinguish a development and a production version) from their example files (prodSettings.py needs the same parameters)
- Make sure that `PROJECT_ROOT = '/sabot'` is set in sabot/localSettings.py (or sabot/prodSettings.py)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mount them using volume mounts or something like this, don't compile them into the docker image.

- create the Docker image
- docker build -t sabot:latest .
- create a container with that image
- docker run -it -p 8000:8000 sabot bash
- run the following scripts to initialize and run the server
- ./init.sh
- ./start.sh

If all was going well you should see the gunicorn server starting up and some logs lines
Open your webbrowser and go to http://localhost:8000

4 changes: 4 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

./manage.py migrate
./manage.py createsuperuser
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ python-rtkit>=0.7.0
requests>=2.12
lxml>=3.7.2
Pillow>=4.0.0
gunicorn==19.9.0
15 changes: 15 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
touch gunicorn.log
touch access.log

tail -n 0 -f *.log &

echo Starting Gunicorn.
exec gunicorn sabot.wsgi:application \
--bind 0.0.0.0:8000 \
--name sabot \
--workers 3 \
--log-level=info \
--log-file=/sabot/gunicorn.log \
--access-logfile=/sabot/access.log \
"$@"