-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile
37 lines (24 loc) · 1007 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
31
32
33
34
35
36
37
FROM alpine/git
ADD ./.git/ /git
RUN git -C /git rev-parse HEAD > /tmp/commit-id
FROM python:3.9-alpine
ENV HTML2PDF_URL=http://html2pdf:5000
RUN adduser -D strokes && mkdir -p /home/strokes && chown -R strokes /home/strokes
WORKDIR /tmp
ADD ./requirements.txt .
RUN pip3 install -r requirements.txt
# I could put it in a separate stage, but I couldn't get it to work w/caching.
ADD ./requirements-dev.txt .
RUN pip3 install -r requirements-dev.txt
USER strokes
WORKDIR /home/strokes
RUN wget -nv https://github.com/skishore/makemeahanzi/blob/master/graphics.txt?raw=true -Ographics.txt
RUN wget -nv https://github.com/skishore/makemeahanzi/blob/master/dictionary.txt?raw=true -Odictionary.txt
ADD ./strokes.py .
ADD ./wiktionary-data.json .
CMD FLASK_APP=strokes.py flask run -h 0.0.0.0
RUN flake8 strokes.py
RUN coverage run --source=. --branch -m nose strokes.py
RUN coverage xml && egrep 'package name="\.".*branch-rate="0.9' coverage.xml
COPY --from=0 /tmp/commit-id commit-id
EXPOSE 5000