Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented method for running webchat in production using docker-com…
…pose using postgres, postfix and uwsgi.
- Loading branch information
1 parent
79e8982
commit fb3783d
Showing
6 changed files
with
111 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data | ||
.git | ||
static_collect |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3 | ||
MAINTAINER dennis@dhedegaard.dk | ||
EXPOSE 9090 | ||
VOLUME ./static_collect | ||
ADD requirements.txt . | ||
RUN pip install -q -r requirements.txt | ||
ADD requirements-prod.txt . | ||
RUN pip install -q -r requirements-prod.txt | ||
ADD . . | ||
CMD python manage.py migrate &&\ | ||
python manage.py collectstatic --noinput &&\ | ||
uwsgi --socket :9090 \ | ||
--processes=5 \ | ||
--harakiri=60 \ | ||
--max-requests=5000 \ | ||
--static-map /static=./static_collect \ | ||
--wsgi-file webchat/wsgi.py |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Docker compose for running the project in production. | ||
# It exposes | ||
# Remember to: | ||
# - change the django secret in settings. | ||
# - change the postfix user/pass. | ||
# - change the postgres pass. | ||
uwsgi: | ||
build: . | ||
volumes: | ||
- ./static_collect:./static_collect | ||
dockerfile: Dockerfile.prod | ||
restart: always | ||
environment: | ||
- WEBCHAT_DEBUG=True | ||
- WEBCHAT_DATABASE=postgres | ||
ports: | ||
- "9090" | ||
links: | ||
- db | ||
|
||
db: | ||
image: postgres | ||
restart: always | ||
environment: | ||
- POSTGRES_USER=webchat | ||
- POSTGRES_PASSWORD=webchat123 | ||
volumes: | ||
- ./data:/var/lib/postgresql/data | ||
|
||
mail: | ||
image: catatnight/postfix | ||
restart: always | ||
environment: | ||
- maildomain=webchat.dhedegaard.dk | ||
- smtp_user=webchat:webchat123 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
uwsgi==2.0.11.1 | ||
psycopg2==2.6.1 |
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