diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..539f033 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Python 3.7 errors on 'ensure_future = asyncio.async' in aiohttp/helpers.py +FROM python:3.6 + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + build-essential \ + libxslt-dev \ + pkg-config \ + python3-dev \ + zlib1g-dev + +RUN pip install pipenv + +WORKDIR /app + +ADD . /app/ +RUN pipenv install + +ENV PYTHONPATH=/app +CMD ["pipenv", "run", "asphalt", "run", "config.docker.yml"] diff --git a/config.docker.yml b/config.docker.yml new file mode 100644 index 0000000..f6793d9 --- /dev/null +++ b/config.docker.yml @@ -0,0 +1,56 @@ +--- +component: + # Do not change this line. Everything will break. + type: owapi.app:APIComponent + + # Is caching via redis enabled? + # This will speed up the API massively for subsequent requests, but data will be stale for 300 seconds. + # Set to False to disable. + use_redis: True + + # Enable profiling? + # This is only recommended for developers. + do_profiling: False + + # Disable ratelimiting? + # This prevents spam for public instances. Private instances should set this to True. + disable_ratelimits: False + + # The time to cache results for. + # By default, this is 300. + # If `use_redis` is False, this statement has no effect. + # If this remains commented, the cache time used will be the default for functions. + #cache_time: 300 + + # Components listing. Do not edit. + components: + # The webapp component. + kyoukai: + # Do not change this line. Everything will break. + app: owapi.app:app + # Launch the app in debug mode? Recommended False for production servers. + debug: True + # The IP for Kyoukai to bind to. + ip: 0.0.0.0 + # The port for Kyoukai to bind to. + port: 4444 + # The redis component. + # This is ignored if `use_redis` is set to False. + redis: + connections: + redis: + # The address of your Redis server. + address: redis + # The port of your Redis server. + port: 6379 + # The database to connect to on Redis. + db: 1 + # The password for your Redis server. + # Do not uncomment if you do not have a password. + # password: hunter2 + + # Enable SSL for this redis connection? + # This must be enabled on the server side too. + ssl: False + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8cf719e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +--- + +version: "3" + +services: + app: + build: . + ports: + - "4444:4444" + + redis: + image: redis