Skip to content

Commit

Permalink
add Makefile, fix up Dockerfile to avoid pip installs
Browse files Browse the repository at this point in the history
  • Loading branch information
voutilad committed Jan 4, 2023
1 parent f678cf1 commit 118cba6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG NA_PYVERSION="${NA_PYVERSION:-3.9}"
FROM python:${NA_PYVERSION}-slim
FROM python:${NA_PYVERSION}-slim AS base

ARG NA_USER="${NA_USER:-guido}"
ARG TOX_DIR="${TOX_DIR:-/tox}"
Expand All @@ -12,9 +12,12 @@ USER "${NA_USER}"
ENV PATH="${PATH}:/pip/.local/bin"

RUN pip install -qq --upgrade pip
COPY . /src
COPY requirements.txt /src
COPY requirements-dev.txt /src

RUN pip install --user -r /src/requirements.txt \
&& pip install --user -r /src/requirements-dev.txt

FROM base AS actual
COPY . /src
ENTRYPOINT ["tox", "-c", "/src/tox.ini", "--root", "${TOX_DIR}", "--workdir", "${TOX_DIR}"]
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
SHELL = /bin/sh
VERSION = 0.3.0

.PHONY: build build-py37 build-py38 build-py39
.PHONE: test test-py37 test-py38 test-py39 clean

all: test

build-py37:
docker build -t "neo4j_arrow:${VERSION}-py37" .

build-py38:
docker build -t "neo4j_arrow:${VERSION}-py38" .

build-py39:
docker build -t "neo4j_arrow:${VERSION}-py39" .

build: build-py37 build-py38 build-py39

test-py37: build-py37
docker run --rm "neo4j_arrow:${VERSION}-py37"

test-py38: build-py38
docker run --rm "neo4j_arrow:${VERSION}-py38"

test-py39: build-py39
docker run --rm "neo4j_arrow:${VERSION}-py39"

test: test-py37 test-py38 test-py39

clean:
echo nop

0 comments on commit 118cba6

Please sign in to comment.