This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make mozillians dockerfiles prod-ready.
- Loading branch information
Showing
9 changed files
with
105 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
#!/bin/sh | ||
|
||
python manage.py migrate | ||
python manage.py runserver 0.0.0.0:8000 |
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,6 @@ | ||
#!/bin/sh | ||
|
||
python manage.py migrate | ||
python manage.py collectstatic --noinput | ||
python manage.py compress --engine jinja2 --extension=.jinja | ||
gunicorn mozillians.wsgi:application -b 0.0.0.0:${PORT:-8000} --log-file - |
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 |
---|---|---|
@@ -1,50 +1,57 @@ | ||
db: | ||
image: mysql:5.5 | ||
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --max_allowed_packet=3M | ||
environment: | ||
- MYSQL_DATABASE=mozillians | ||
- MYSQL_USER=mozillians | ||
- MYSQL_PASSWORD=mozillians | ||
- MYSQL_ROOT_PASSWORD=root | ||
es: | ||
image: barnybug/elasticsearch:1.2.1 | ||
memcached: | ||
image: memcached | ||
broker: | ||
image: rabbitmq:3-management | ||
ports: | ||
- "15672:15672" | ||
web: | ||
build: . | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- .:/code | ||
links: | ||
- db | ||
- es | ||
- memcached | ||
- broker | ||
command: bash -c "python manage.py migrate --noinput && python manage.py runserver 0.0.0.0:8000" | ||
celery: | ||
build: . | ||
volumes: | ||
- .:/code | ||
links: | ||
- db | ||
- es | ||
- broker | ||
- memcached | ||
command: celery -A mozillians worker -B -l INFO | ||
environment: | ||
- C_FORCE_ROOT=true | ||
flower: | ||
build: . | ||
volumes: | ||
- .:/code | ||
links: | ||
- db | ||
- broker | ||
ports: | ||
- "5555:5555" | ||
command: flower -A mozillians --address=0.0.0.0 --port=5555 | ||
version: '2' | ||
services: | ||
db: | ||
image: mysql:5.5 | ||
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --max_allowed_packet=3M | ||
environment: | ||
- MYSQL_DATABASE=mozillians | ||
- MYSQL_USER=mozillians | ||
- MYSQL_PASSWORD=mozillians | ||
- MYSQL_ROOT_PASSWORD=root | ||
es: | ||
image: elasticsearch:1.7 | ||
memcached: | ||
image: memcached | ||
broker: | ||
image: rabbitmq:3-management | ||
ports: | ||
- "15672:15672" | ||
web: | ||
build: | ||
context: . | ||
dockerfile: docker/dev | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- .:/code | ||
links: | ||
- db | ||
- es | ||
- memcached | ||
- broker | ||
celery: | ||
build: | ||
context: . | ||
dockerfile: docker/dev | ||
volumes: | ||
- .:/code | ||
links: | ||
- db | ||
- es | ||
- broker | ||
- memcached | ||
command: celery -A mozillians worker -B -l INFO | ||
environment: | ||
- C_FORCE_ROOT=true | ||
flower: | ||
build: | ||
context: . | ||
dockerfile: docker/dev | ||
volumes: | ||
- .:/code | ||
links: | ||
- db | ||
- broker | ||
ports: | ||
- "5555:5555" | ||
command: flower -A mozillians --address=0.0.0.0 --port=5555 |
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,14 @@ | ||
FROM python:2.7-slim | ||
|
||
EXPOSE 8000 | ||
WORKDIR /code | ||
CMD ["./bin/run-dev.sh"] | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential libxml2-dev libxslt-dev \ | ||
mysql-client libmysqlclient-dev node-less gettext node-less && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY requirements /code/requirements/ | ||
RUN pip install --require-hashes --no-deps -r requirements/dev.txt |
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,19 @@ | ||
FROM python:2.7-slim | ||
|
||
EXPOSE 8000 | ||
WORKDIR /code | ||
CMD ["./bin/run-prod.sh"] | ||
|
||
RUN adduser --uid 431 --disabled-password --disabled-login --gecos 'webdev' --no-create-home webdev | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential libxml2-dev libxslt-dev \ | ||
mysql-client libmysqlclient-dev node-less gettext node-less && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY requirements /code/requirements/ | ||
RUN pip install --require-hashes --no-deps -r requirements/prod.txt | ||
COPY . /code | ||
|
||
RUN chown webdev.webdev -R . | ||
USER webdev |
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 @@ | ||
../wsgi/playdoh.wsgi |
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