Commit 200b71db authored by JackV's avatar JackV
Browse files

Docker integration

parent 40c289dc
FROM alpine:latest
RUN apk add -U python3 py3-gunicorn
RUN mkdir /uus
WORKDIR /uus
COPY uus.py /uus
COPY admin /uus
COPY requirements.txt /uus
RUN pip3 install -r requirements.txt
EXPOSE 8000
ENTRYPOINT gunicorn -b 0.0.0.0 -w 4 uus:app
version: '3'
services:
uus:
image: uus
restart: always
environment:
- REDIS_URL=redis://redis_db:6379/0
depends_on:
- redis_db
ports:
- "9001:8000"
redis_db:
image: redis:alpine
restart: always
entrypoint: redis-server --appendonly yes
volumes:
- /data:/opt/uus
......@@ -8,7 +8,7 @@ import os
app = flask.Flask(__name__)
auth = HTTPBasicAuth()
app.config['REDIS_URL'] = 'redis://127.0.0.1:6379/0'
app.config['REDIS_URL'] = os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379/0')
redis_store = FlaskRedis()
redis_store.init_app(app)
pure_string = re.compile(r'^\w+$')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment