build related

This commit is contained in:
dave 2023-07-20 00:23:45 -07:00
parent 5c06377ccf
commit 827dff9611
3 changed files with 33 additions and 5 deletions

View File

@ -1 +1,5 @@
testenv
/testenv/
build/*
dist/*
*.egg-info/*
__pycache__

View File

@ -1,14 +1,18 @@
FROM ubuntu:focal
RUN apt-get update && \
apt-get install -y python3-pip
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip && \
rm -rf /var/lib/apt/lists/*
ADD requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
ADD scrape.py /usr/local/bin/scrape.py
ADD . /tmp/code/
RUN chmod +x /usr/local/bin/scrape.py
RUN cd /tmp/code && \
python3 setup.py install
ENTRYPOINT ["/usr/local/bin/scrape.py"]
USER nobody
ENTRYPOINT ["osrsscrape"]

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
DOCKERIMAGE := dockermirror:5000/dpedu/rsscrape
DOCKEROPTS :=
BINARY := dist/osrsscrape-0.0.0-py3-none-any.whl
.PHONY: $(BINARY)
$(BINARY):
python3 setup.py bdist_wheel
.PHONY: image
image:
docker build -t $(DOCKERIMAGE) $(DOCKEROPTS) .
.PHONY: push
push: image
docker push $(DOCKERIMAGE)
.PHONY: testenv
testenv:
virtualenv -p python3 testenv
testenv/bin/pip3 install -r requirements.txt