[niko-niko] Initial commit

This commit is contained in:
drymer 2018-10-07 01:18:51 +02:00
parent 32a92a491b
commit e40fe119ae
Signed by: drymer
GPG Key ID: A307D64D5DDFDAAD
2 changed files with 44 additions and 0 deletions

23
niko-niko/Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM alpine:3.7 as builder
RUN mkdir -p /var/cache/apk /niko-niko && ln -s /var/cache/apk /etc/apk/cache && apk add \
--update gcc musl-dev py2-pip python-dev git
RUN git clone https://github.com/glebb/feelings /niko-niko
RUN pip install wheel && pip wheel --wheel-dir=/root/wheel -r /niko-niko/requirements.txt
FROM alpine:3.7 as production
COPY --from=builder /root/wheel /root/wheel
COPY --from=builder /root/.cache /root/.cache
COPY --from=builder /etc/apk/cache /etc/apk/cache
COPY --from=builder /niko-niko/ /niko-niko
RUN apk add --update py2-pip python && pip install --no-index \
--find-links=/root/wheel -r /niko-niko/requirements.txt
RUN rm -rf /root/.cache /etc/apk/cache/* /root/wheel/
WORKDIR /niko-niko
CMD ["python", "tornado_server.py"]
EXPOSE 8080

21
niko-niko/README.md Normal file
View File

@ -0,0 +1,21 @@
# Niko-niko calendar
A calendar to see the feelings of one or more people.
## Configuration
Copy the sqlite database:
``` bash
docker run -ti --name niko-niko niko-niko sleep 1
docker cp niko-niko:/niko-niko/feelings.sqlite .
```
Run the webserver:
``` bash
docker run -ti -p 8080:8080 -v `pwd`/feelings.sqlite:/niko-niko/feelings.sqlite niko-niko
```
## Use
The application supports multiple users. You can use it attacking to
`http://whatever:8080/?category=name`. You can visualiza the data at
`http://whatever:8080/results` or `http://whatever:8080/show_avg`. You may
filter using the `category` parameter.