feat: refactor Dockerfile

This commit is contained in:
2023-01-09 15:19:55 +01:00
parent d0fc1aca74
commit 31f683f766
3 changed files with 49 additions and 26 deletions
+16 -26
View File
@@ -1,29 +1,19 @@
FROM python:3
FROM python:3.9-slim-bullseye
LABEL maintainer="Joakim Olsson <joakim@unbound.se>"
LABEL description="Base image for running Robot Framework test suites in Docker. \
\
The image cotains the following Robot Framework libraries:\
- Appium library - Keywords for Android & IOS device UI tests \
- Database library - Keywords for SQL queries & statements \
- HTTP library - Keywords for HTTP & Rest \
- RabbitMQ library - Keywords for Rabbit MQ \
- Selenium2 library - Keywords for cross browser tests\
\
Drivers:\
- psycopg2 - Python driver for Postgres \
- PyMySQL - Python driver for MySQL"
ARG TARGETOS
ARG TARGETARCH
ARG GECKODRIVER_VERSION=0.32.0
RUN apt-get update && \
apt-get -y install jq firefox-esr && \
rm -r /var/lib/apt/lists/* && \
pip install \
urllib3 \
psycopg2-binary \
PyMySQL \
robotframework==6.0.1 \
robotframework-appiumlibrary \
robotframework-databaselibrary \
robotframework-httplibrary \
-e "git+https://github.com/JakUi/robotframework-rabbitmq-fork#egg=robotframework-rabbitmq-ao" \
robotframework-selenium2library
apt-get -y install jq firefox-esr curl git && \
rm -r /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && \
rm requirements.txt
COPY geckodriver.sh .
RUN ./geckodriver.sh $GECKODRIVER_VERSION $TARGETOS $TARGETARCH && \
rm geckodriver.sh
# echo "192.168.65.2 app-acctest auth0 api-acctest" >> /etc/hosts