-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
63 lines (47 loc) · 2 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM python:3.8-slim AS builder
WORKDIR /docs
COPY docs /docs
RUN pip --no-cache-dir install -U pip \
&& pip --no-cache-dir install sphinx
RUN apt-get update && \
apt-get install -y --no-install-recommends \
\
make \
&& rm -rf /var/lib/apt/lists/*
RUN make -C /docs
FROM python:3.8-slim
ARG BUILD_DATE=""
ARG BUILD_VERSION="dev"
LABEL maintainer="OpenTTD Dev Team <[email protected]>"
LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.authors="OpenTTD Dev Team <[email protected]>"
LABEL org.opencontainers.image.url="https://github.com/OpenTTD/eints"
LABEL org.opencontainers.image.source="https://github.com/OpenTTD/eints"
LABEL org.opencontainers.image.version=${BUILD_VERSION}
LABEL org.opencontainers.image.licenses="GPLv2"
LABEL org.opencontainers.image.title="WebTranslator for OpenTTD and its add-ons"
LABEL org.opencontainers.image.description="Eints Is a Newgrf Translation Service. Though now it is also used for Game Scripts and OpenTTD itself."
WORKDIR /code
COPY requirements.txt \
LICENSE.md \
README.md \
/code/
# Needed for Sentry to know what version we are running
RUN echo "${BUILD_VERSION}" > /code/.version
RUN pip --no-cache-dir install -U pip \
&& pip --no-cache-dir install -r requirements.txt
# Validate that what was installed was what was expected
RUN pip freeze 2>/dev/null > requirements.installed \
&& diff -u --strip-trailing-cr requirements.txt requirements.installed 1>&2 \
|| ( echo "!! ERROR !! requirements.txt defined different packages or versions for installation" \
&& exit 1 ) 1>&2
COPY rights_example.dat /code/rights.dat
COPY static /code/static
COPY stable_languages /code/stable_languages
RUN mkdir -p /code/unstable_languages
COPY views /code/views
COPY webtranslate /code/webtranslate
COPY --from=builder /docs/manual/_build/html /code/static/docs
VOLUME ["/data"]
ENTRYPOINT ["python", "-m", "webtranslate", "--project-root", "/data", "--server-host", "0.0.0.0"]
CMD []