-
-
Notifications
You must be signed in to change notification settings - Fork 116
/
Dockerfile
46 lines (31 loc) · 1.07 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
#------- Build
FROM crowdin/cli:latest as builder
ARG GITHUB_USER
ARG GITHUB_TOKEN
ARG GITHUB_REPO
ARG GITHUB_VERSION
ARG CROWDIN_TOKEN
ARG CROWDIN_PROJECT_ID
ARG CROWDIN_BASE_URL
ARG VERSION
RUN apk add --no-cache python3 bash zip
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install -U -r requirements.txt
COPY . /app
RUN sphinx-build -W -d build/doctrees source build/html
RUN sphinx-build -W -q -b gettext source build/locale
RUN cd /app && crowdin download -b ${VERSION}
RUN sphinx-intl build > /dev/null
RUN export VERSIONS=`list-versions` \
&& translations=`list-translations ${VERSION}` \
&& for version in $VERSIONS ; do export LOCALES_$(echo $version | tr '.' '_')="en $(list-translations $version)" ; done \
&& export LOCALES="en $translations" \
&& build-language en \
&& echo "$translations" | xargs -n1 -P4 build-language
#------- Copy to nginx
FROM nginx:1.25.3-alpine
COPY --from=builder /app/dist /usr/share/nginx/html