Commit 1cee8983 authored by Emanuele Aina's avatar Emanuele Aina

Dockerfile: Add a stage for running unittest

Use the multi-stage support to build a `unittest` stage carrying the
extra dependencies needed to run unit tests without polluting the
production image.

To run the unit tests in docker:

    docker build -t qa-report-app-unittest --target unittest .
    docker run -t --user $UID -v $(pwd):/app -w /app qa-report-app-unittest pytest-3
Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 61e80999
FROM debian:stretch-slim
ARG DEBIAN_FRONTEND=noninteractive
FROM debian:stretch-slim AS base
LABEL description="Apertis QA test results collection and reporting application"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install --no-install-recommends -y python3-all \
python3-setuptools \
python3-wheel \
python3-pip \
python3-yaml \
python3-phabricator \
python3-yattag \
ca-certificates \
wait-for-it \
python3-flask \
python3-flask-migrate \
python3-flask-script \
python3-flask-sqlalchemy \
python3-psycopg2 \
python3-oauthlib \
python3-blinker \
python3-requests-oauthlib \
python3-urlobject \
&& rm -rf /var/lib/apt/lists/*
apt install --no-install-recommends -y \
ca-certificates \
python3-all \
python3-blinker \
python3-flask \
python3-flask-migrate \
python3-flask-script \
python3-flask-sqlalchemy \
python3-oauthlib \
python3-phabricator \
python3-pip \
python3-psycopg2 \
python3-requests-oauthlib \
python3-setuptools \
python3-urlobject \
python3-wheel \
python3-yaml \
python3-yattag \
wait-for-it
RUN pip3 install Flask-Dance
FROM base AS unittest
LABEL description="Apertis QA test results collection and reporting application - unittest environment"
RUN apt update && \
apt install --no-install-recommends -y \
python3-pytest
FROM base AS runtime
LABEL description="Apertis QA test results collection and reporting application - runtime environment"
WORKDIR /app
ADD . /app
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment