forked from empathic-code/peter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (21 loc) · 965 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM alpine:latest
MAINTAINER Johannes Hofmeister <docker@spam.cessor.de>
# To Build:
# docker build -t cessor/peter -f Dockerfile .
# To Run:
# docker run --name peter -d -p 5000:5000 --link mongodb:mongodb cessor/peter
RUN apk add --update bash curl g++ python python-dev py-pip && \
rm -rf /var/cache/apk/*
RUN pip install pip --upgrade
RUN pip install setuptools --upgrade
RUN pip install tornado
RUN pip install motor
ADD ./src /var/peter
# Generate Cookie Secret Key
RUN python -c "import random,string; print 'cookie_secret=\'%s\'' % ''.join([random.choice(string.letters+string.digits) for _ in range(32)])" >> /var/peter/config/docker.cfg
# Generate Admin Password
RUN python -c "import random,string; print ''.join([random.choice(string.letters+string.digits) for _ in range(12)])" > /var/peter/.key
# Write this down.
RUN echo Your Password for /admin/login is: $(cat /var/peter/.key)
ENV PETER_ENV=docker
CMD python /var/peter/serve-fast.py