-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathDockerfile
79 lines (69 loc) · 2.16 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:latest AS base
ENV PATH="/root/.local/bin:$PATH"
ENV TZ=Europe/London
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-pip \
python3 \
pipx \
ffmpeg \
tzdata \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man \
&& apt-get clean
FROM base AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
libffi-dev \
libssl-dev \
systemd \
systemd-sysv \
python3-dev \
python3-venv \
wget \
gnupg2 \
xvfb \
golang \
git \
&& rm -rf /var/lib/apt/lists/* \
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man \
&& apt-get clean
ENV DISPLAY=:99
ARG CHROME_VERSION="google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update -qqy \
&& apt-get -qqy install \
${CHROME_VERSION:-google-chrome-stable} \
&& rm /etc/apt/sources.list.d/google-chrome.list \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN pipx install poetry
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
RUN . /root/.bashrc && nvm install 22
RUN . /root/.bashrc && npm i -g pnpm@latest-10
RUN mkdir /work/
COPY . /work
WORKDIR /work
RUN rm -rf /work/namer/__pycache__/ || true \
&& rm -rf /work/test/__pycache__/ || true \
&& poetry install
RUN . /root/.bashrc && ( Xvfb :99 & cd /work/ && poetry run poe build_all )
FROM base
COPY --from=build /work/dist/namer-*.tar.gz /
RUN pipx install /namer-*.tar.gz \
&& rm /namer-*.tar.gz
ARG BUILD_DATE
ARG GIT_HASH
ARG PROJECT_VERSION
ENV PYTHONUNBUFFERED=1
ENV NAMER_CONFIG=/config/namer.cfg
ENV BUILD_DATE=$BUILD_DATE
ENV GIT_HASH=$GIT_HASH
ENV PROJECT_VERSION=$PROJECT_VERSION
EXPOSE 6980
HEALTHCHECK --interval=1m --timeout=30s CMD curl -s $(namer url)/api/healthcheck >/dev/null || exit 1
ENTRYPOINT ["namer", "watchdog"]