mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
44cf98a159
The Dockerfile did not work as is, because the dependencies in requirements.txt are newer than the stretch-image with its python v3.5 can support/run. Use stable debian with the lts nodejs instead, plus had to add some libs to make the wheel build succeed. jsonschema v4 breaks things, so its version needs to be pinned until bravado is fixed [0]. [0] https://github.com/Yelp/bravado-core/pull/385/files#r731674447
35 lines
1.4 KiB
Docker
35 lines
1.4 KiB
Docker
FROM debian:stable-slim
|
|
LABEL maintainer="k@ndk.name"
|
|
|
|
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
|
|
|
|
RUN apt-get update -y \
|
|
&& apt-get install -y --no-install-recommends apt-transport-https locales locales-all python3-pip python3-setuptools python3-dev curl libsasl2-dev libldap2-dev libssl-dev libxml2-dev libxslt1-dev libxmlsec1-dev libffi-dev libxmlsec1-openssl pkg-config build-essential libmariadb-dev-compat \
|
|
&& curl -sL https://deb.nodesource.com/setup_lts.x | bash - \
|
|
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
|
&& apt-get update -y \
|
|
&& apt-get install -y nodejs yarn \
|
|
&& apt-get clean -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# We copy just the requirements.txt first to leverage Docker cache
|
|
COPY ./requirements.txt /app/requirements.txt
|
|
|
|
WORKDIR /app
|
|
RUN pip3 install --upgrade pip
|
|
RUN pip3 install -r requirements.txt
|
|
|
|
COPY . /app
|
|
COPY ./docker/entrypoint.sh /usr/local/bin/
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
ENV FLASK_APP=powerdnsadmin/__init__.py
|
|
RUN yarn install --pure-lockfile --production \
|
|
&& yarn cache clean \
|
|
&& flask assets build
|
|
|
|
COPY ./docker-test/wait-for-pdns.sh /opt
|
|
RUN chmod u+x /opt/wait-for-pdns.sh
|
|
CMD ["/opt/wait-for-pdns.sh", "/usr/local/bin/pytest","--capture=no","-vv"]
|