Skip to content
Closed
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
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:latest

# install python
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip

# copy project
COPY . /

# install libs
RUN apt-get -y install git libxslt-dev libxml2-dev python3-lxml python3-crypto

# install requirements
RUN pip3 install -r requirements.txt

# rename settings example com
RUN cp tapiriik/local_settings.py.example tapiriik/local_settings.py

# generate keys
RUN python3 credentialstore_keygen.py >> tapiriik/local_settings.py

# run server, worker and scheduler
ENTRYPOINT python3 manage.py runserver 0.0.0.0:8000 && python3 sync_worker.py && python3 sync_scheduler.py
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3'
services:
tapiriik:
build: .
environment:
- RABBITMQ_BROKER_URL=amqp://guest@tapiriik_rabbitmq//
- MONGO_HOST=mongodb://root:example@tapiriik_mongo:27017/admin
- REDIS_HOST=tapiriik_redis
ports:
- "8000:8000"
links:
- tapiriik_redis
- tapiriik_mongo
- tapiriik_rabbitmq
tapiriik_redis:
image: redis
tapiriik_mongo:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
tapiriik_rabbitmq:
image: rabbitmq:3-management
6 changes: 3 additions & 3 deletions tapiriik/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@

TEST_RUNNER = 'tapiriik.testing.MongoDBTestRunner'

MONGO_HOST = "localhost"
MONGO_HOST = os.getenv("MONGO_HOST", "localhost")
MONGO_REPLICA_SET = None
MONGO_CLIENT_OPTIONS = {}
MONGO_FULL_WRITE_CONCERN = 1

REDIS_HOST = "localhost"
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_CLIENT_OPTIONS = {}

WEB_ROOT = 'http://localhost:8000'
Expand Down Expand Up @@ -267,7 +267,7 @@

HTTP_SOURCE_ADDR = "0.0.0.0"

RABBITMQ_BROKER_URL = "amqp://guest@localhost//"
RABBITMQ_BROKER_URL = os.getenv("RABBITMQ_BROKER_URL", "amqp://guest@localhost//")

RABBITMQ_USER_QUEUE_STATS_URL = "http://guest:guest@localhost:15672/api/queues/%2F/tapiriik-users?lengths_age=3600&lengths_incr=60&msg_rates_age=3600&msg_rates_incr=60"

Expand Down