-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
507 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
* | ||
!Pipfile* | ||
!requirements*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
**/.docker/ | ||
requirements*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,5 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
|
||
FROM python:$PYTHON_VERSION AS lock | ||
FROM python:$PYTHON_VERSION | ||
WORKDIR /var/lib/pandas/ | ||
RUN pip install pipenv==2023.8.28 | ||
RUN pipenv --python $PYTHON_VERSION | ||
COPY Pipfile* ./ | ||
RUN pipenv lock | ||
RUN pipenv requirements > requirements.txt | ||
RUN pipenv requirements --dev-only > requirements-dev.txt | ||
|
||
FROM python:$PYTHON_VERSION AS latest | ||
WORKDIR /var/lib/pandas/ | ||
COPY --from=lock /var/lib/pandas/ . | ||
RUN pip install $(grep -Eoh 'numpy==[0-9.]+' requirements.txt) && \ | ||
pip install -r requirements.txt | ||
|
||
FROM python:$PYTHON_VERSION AS jupyter | ||
WORKDIR /var/lib/pandas/ | ||
COPY --from=lock /var/lib/pandas/ . | ||
RUN pip install $(grep -Eoh 'numpy==[0-9.]+' requirements.txt) && \ | ||
pip install -r requirements.txt -r requirements-dev.txt | ||
|
||
FROM python:$PYTHON_VERSION-slim AS slim | ||
WORKDIR /var/lib/pandas/ | ||
COPY --from=lock /var/lib/pandas/ . | ||
RUN pip install $(grep -Eoh 'numpy==[0-9.]+' requirements.txt) && \ | ||
pip install -r requirements.txt | ||
|
||
FROM python:$PYTHON_VERSION-alpine as alpine | ||
WORKDIR /var/lib/pandas/ | ||
COPY --from=lock /var/lib/pandas/ . | ||
RUN apk add --no-cache libstdc++ && \ | ||
apk add --no-cache --virtual .build-deps g++ && \ | ||
ln -s /usr/include/locale.h /usr/include/xlocale.h && \ | ||
pip install $(grep -Eoh 'numpy==[0-9.]+' requirements.txt) && \ | ||
pip install -r requirements.txt && \ | ||
apk del .build-deps | ||
COPY . . | ||
RUN pip install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
FROM python:$PYTHON_VERSION-alpine | ||
WORKDIR /var/lib/pandas/ | ||
COPY . . | ||
RUN apk add --no-cache libstdc++ && \ | ||
apk add --no-cache --virtual .build-deps g++ && \ | ||
ln -s /usr/include/locale.h /usr/include/xlocale.h && \ | ||
pip install -r requirements.txt && \ | ||
apk del .build-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
FROM python:$PYTHON_VERSION | ||
WORKDIR /var/lib/pandas/ | ||
COPY . . | ||
RUN pip install -r requirements.txt -r requirements-dev.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
FROM python:$PYTHON_VERSION-slim | ||
WORKDIR /var/lib/pandas/ | ||
COPY . . | ||
RUN pip install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
REPO := amancevice/pandas | ||
PANDAS_VERSION := $(shell grep pandas Pipfile | grep -o '[0-9.]\+') | ||
PANDAS_VERSION := $(shell grep pandas Pipfile | grep -Eo '[0-9.]+') | ||
PIPENV_VERSION := $(shell pipenv --version | grep -Eo '[0-9.]+') | ||
PYTHON_VERSION := $(shell python --version | grep -Eo '[0-9.]+') | ||
|
||
all: Pipfile.lock | ||
|
||
clean: | ||
docker image ls --quiet $(REPO) | uniq | xargs docker image rm --force | ||
docker image rm --force $(shell docker image ls --quiet $(REPO) | uniq | xargs) | ||
|
||
alpine slim jupyter: lock | ||
docker build --tag $(REPO):$@ --tag $(REPO):$(PANDAS_VERSION)-$@ --target $@ . | ||
push: | ||
docker push --all-tags $(REPO) | ||
|
||
latest: | ||
docker build --tag $(REPO):$@ --tag $(REPO):$(PANDAS_VERSION) --target $@ . | ||
Dockerfile: requirements.txt | ||
docker build --build-arg PYTHON_VERSION=$(PYTHON_VERSION) --tag $(REPO) --tag $(REPO):$(PANDAS_VERSION) . | ||
|
||
lock: Pipfile.lock | ||
Dockerfile.%: requirements.txt requirements-dev.txt | ||
docker build --build-arg PYTHON_VERSION=$(PYTHON_VERSION) --file $@ --tag $(REPO):$* --tag $(REPO):$(PANDAS_VERSION)-$* . | ||
|
||
ls: | ||
docker image ls $(REPO) | ||
.PHONY: all clean push Dockerfile Dockerfile.% | ||
|
||
push: | ||
docker push --all-tags $(REPO) | ||
requirements.txt: | ||
pipenv requirements > requirements.txt | ||
|
||
requirements-dev.txt: | ||
pipenv requirements --dev > requirements-dev.txt | ||
|
||
.PHONY: all clean push alpine slim jupyter latest lock ls push | ||
Pipfile.lock: .venv | ||
docker container run --detach --rm --name pandas python:3.11.5 python -m http.server | ||
docker container exec --tty pandas pip install pipenv==$(PIPENV_VERSION) &> /dev/null | ||
docker container cp Pipfile* pandas:/tmp/ | ||
docker container exec --tty --workdir /tmp/ pandas pipenv lock | ||
docker container cp pandas:/tmp/Pipfile.lock . | ||
docker container stop pandas | ||
|
||
Pipfile.lock: Pipfile | ||
docker build --tag $(REPO):lock --target lock . | ||
docker run --rm --entrypoint cat $(REPO):lock $@ > $@ | ||
.venv: Pipfile | ||
mkdir -p $@ | ||
pipenv --python $(PYTHON_VERSION) | ||
touch $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.