Skip to content

Instantly share code, notes, and snippets.

View Mishco's full-sized avatar
🎯
Focusing

Michal Slovík Mishco

🎯
Focusing
View GitHub Profile
version: "3.9"
services:
test:
environment:
- PYTHONPATH=./src
image: "sparktest"
build:
context: .
dockerfile: ./Dockerfile
volumes:
- task: Docker@2
displayName: 'Build an image'
inputs:
repository: 'sparktest'
command: 'build'
Dockerfile: '**/Dockerfile'
tags: 'latest'
- script: |
docker run -e PYTHONPATH=./src -v :/app --name sparktest sparktest
WORKDIR app
RUN apt-get update && apt-get install -y build-essential libxml2
COPY . /app
RUN pip3 install cython numpy pytest pandas coverage pyspark_test dummy_spark IPython pytest-cov
RUN pip3 install -r requirements.txt
ENTRYPOINT python3 -m coverage run --source=. -m pytest -v test/ && coverage report && coverage xml && cat coverage.xml
ARG PYSPARK_VERSION=3.2.0
RUN pip --no-cache-dir install pyspark==${PYSPARK_VERSION}
ARG IMAGE_VARIANT=slim-buster
ARG OPENJDK_VERSION=8
ARG PYTHON_VERSION=3.9.8
FROM python:${PYTHON_VERSION}-${IMAGE_VARIANT} AS py3
FROM openjdk:${OPENJDK_VERSION}-${IMAGE_VARIANT}
Python 3.11.2 (main, Mar 1 2023, 14:46:02) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> import numpy as np
>>>
FROM python:latest
RUN pip install --upgrade pip
ADD requirements.txt .
RUN pip install -r requirements.txt
root@704b87b076d8:~# ls /app/
Dockerfile solver.py
root@704b87b076d8:~# python /app/solver.py
a: 1
b: 10
c: 1
(-0.10102051443364424, -9.898979485566356)
root@704b87b076d8:~# python --version
Python 3.11.2
FROM python:latest
WORKDIR /app
COPY . ./