This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from quokkaproject/dockerized
Dockerized
- Loading branch information
Showing
19 changed files
with
288 additions
and
96 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
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,25 +1,10 @@ | ||
FROM ubuntu:14.04 | ||
|
||
FROM alpine | ||
MAINTAINER Bruno Rocha <rochacbruno@gmail.com> | ||
|
||
ADD . /quokka | ||
WORKDIR /quokka | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install nginx sed python-pip python-dev uwsgi-plugin-python supervisor libjpeg-dev | ||
|
||
RUN mkdir -p /var/log/nginx/app | ||
RUN mkdir -p /var/log/uwsgi/app/ | ||
|
||
RUN rm /etc/nginx/sites-enabled/default | ||
COPY quokka_nginx.conf /etc/nginx/sites-available/quokka.conf | ||
RUN ln -s /etc/nginx/sites-available/quokka.conf /etc/nginx/sites-enabled/quokka.conf | ||
|
||
RUN mkdir -p /var/log/supervisor | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
CMD ["/usr/bin/supervisord"] | ||
WORKDIR /tmp | ||
COPY requirements.txt /tmp/ | ||
RUN apk update | ||
RUN apk add gcc python py-pip libjpeg zlib zlib-dev tiff freetype git py-pillow python-dev musl-dev bash | ||
RUN pip install -r /tmp/requirements.txt | ||
RUN pip install ipython | ||
|
||
# docker run --link <mongo_container_id>:mongo -v $PWD:/quokka -t -i quokka/quokkadev /bin/bash |
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,54 @@ | ||
mongo: | ||
image: mongo | ||
ports: | ||
- "27017:27017" | ||
volumes: | ||
- etc/mongodata:/data/db | ||
|
||
# elastic: | ||
# image: catholabs/elastic-with-marvel | ||
# command: elasticsearch | ||
# volumes: | ||
# - etc/elasticdata:/usr/share/elasticsearch/data | ||
# ports: | ||
# - "9200:9200" | ||
# mem_limit: 1000000000 | ||
|
||
web: | ||
restart: always | ||
image: quokka/quokkadev | ||
working_dir: /quokka | ||
ports: | ||
- "5000:5000" | ||
volumes: | ||
- .:/quokka | ||
links: | ||
- mongo:mongo | ||
# - elastic:elastic | ||
command: sh etc/docker_wait_to_start.sh | ||
environment: | ||
- QUOKKA_MONGODB_HOST=mongo | ||
- WAIT_COMMAND=$(nc -zv mongo 27017) | ||
- WAIT_START_CMD=python manage.py runserver --host 0.0.0.0 --reload --debug | ||
- WAIT_SLEEP=2 | ||
- WAIT_LOOPS=10 | ||
mem_limit: 1000000000 | ||
|
||
shell: | ||
image: quokka/quokkadev | ||
working_dir: /quokka | ||
volumes: | ||
- .:/quokka | ||
links: | ||
- mongo:mongo | ||
# - elastic:elastic | ||
- web:web | ||
mem_limit: 1000000000 | ||
command: /bin/bash | ||
stdin_open: true | ||
tty: true | ||
privileged: true | ||
environment: | ||
- RECSYS_ENV=docker | ||
- C_FORCE_ROOT=1 | ||
- QUOKKA_MONGODB_HOST=mongo |
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,29 @@ | ||
#!/bin/bash | ||
|
||
|
||
#WAIT_COMMAND='[ $(curl --write-out %{http_code} --silent --output /dev/null http://elastic:9200/_cat/health?h=st) = 200 ]' | ||
#WAIT_LOOPS=3 | ||
#WAIT_START_CMD="python -V" | ||
#WAIT_SLEEP=2 | ||
|
||
echo $WAIT_COMMAND | ||
echo $WAIT_START_CMD | ||
|
||
is_ready() { | ||
eval "$WAIT_COMMAND" | ||
} | ||
|
||
# wait until is ready | ||
i=0 | ||
while ! is_ready; do | ||
i=`expr $i + 1` | ||
if [ $i -ge $WAIT_LOOPS ]; then | ||
echo "$(date) - still not ready, giving up" | ||
exit 1 | ||
fi | ||
echo "$(date) - waiting to be ready" | ||
sleep $WAIT_SLEEP | ||
done | ||
|
||
#start the script | ||
exec $WAIT_START_CMD |
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.