Browse Source

Docker build env

pull/1/head
parent
commit
999d07c901
  1. 1
      .gitignore
  2. 26
      Dockerfile
  3. 20
      Dockerfile.build
  4. 37
      poetry.lock
  5. 7
      pyproject.toml

1
.gitignore

@ -6,3 +6,4 @@ zflux/__pycache__
*.log
zflux.egg-info/
dist/
zflux*.tar.gz

26
Dockerfile

@ -1,20 +1,28 @@
FROM python:3.8
FROM benediktkr/poetry:latest
MAINTAINER Benedikt Kristinsson <benedikt@lokun.is>
RUN useradd -u 1211 -ms /bin/bash zflux
RUN mkdir /zflux
COPY zflux/ /zflux/zflux/
COPY tests/ /zlux/tests/
COPY pyproject.toml /zflux/pyproject.toml
COPY poetry.lock /zflux/poetry.lock
# RUN mkdir /zflux
# COPY zflux/ /zflux/zflux/
# COPY tests/ /zlux/tests/
# COPY pyproject.toml /zflux/pyproject.toml
# COPY poetry.lock /zflux/poetry.lock
RUN pip install /zflux
#RUN pip install /zflux
# idea is to override with bind mounts
# since config.py doesnt do env vars as-is
ENV ZFLUX_CONF "/etc/zflux.yml"
COPY --from=build-zflux /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
WORKDIR /app
COPY pyproject.toml poetry.lock /app/
COPY zflux/ /app/zflux/
RUN poetry install --no-dev
ENV ZFLUX_CONF "/etc/zflux.yml"
EXPOSE 5558
USER 1211
ENTRYPOINT ["zflux"]
CMD ["zflux"]

20
Dockerfile.build

@ -1,13 +1,19 @@
FROM benediktkr/poetry:latest
MAINTAINER Benedikt Kristinsson <benedikt@lokun.is>
RUN mkdir /zflux
COPY zflux/ /zflux/zflux/
COPY tests/ /zlux/tests/
COPY pyproject.toml /zflux/pyproject.toml
COPY poetry.lock /zflux/poetry.lock
WORKDIR /zflux
RUN mkdir /app
WORKDIR /app
#RUN apt-get update && apt-get install -y libczmq-dev libczmq
#RUN poetry config virtualenvs.create true
COPY poetry.lock pyproject.toml /app/
RUN poetry install --no-dev
ENTRYPOINT ["poetry"]
CMD ["build", "-f", "sdist"]
CMD ["build"]
# check this: https://jenkins.sudo.is/job/zflux/16/console

37
poetry.lock

@ -13,11 +13,11 @@ description = "Classes Without Boilerplate"
name = "attrs"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "20.2.0"
version = "20.3.0"
[package.extras]
dev = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "sphinx-rtd-theme", "pre-commit"]
docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"]
dev = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"]
docs = ["furo", "sphinx", "zope.interface"]
tests = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"]
tests_no_zope = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"]
@ -181,7 +181,7 @@ description = "World timezone definitions, modern and historical"
name = "pytz"
optional = false
python-versions = "*"
version = "2020.1"
version = "2020.4"
[[package]]
category = "main"
@ -258,19 +258,8 @@ version = "1.0.3"
[package.extras]
dev = ["pytest (>=4.6.2)", "black (>=19.3b0)"]
[[package]]
category = "main"
description = "You are probably looking for pyzmq."
name = "zmq"
optional = false
python-versions = "*"
version = "0.0.0"
[package.dependencies]
pyzmq = "*"
[metadata]
content-hash = "87ac35f9fb4d5c1edc53637d5ba040bb3fdd1141e3156c9eee50322711e998c6"
content-hash = "2d02327614939962ff4c6dc35c102a51a08919981e1e81d5e3bcd9279eda5da9"
lock-version = "1.0"
python-versions = "^3.8"
@ -280,8 +269,8 @@ atomicwrites = [
{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},
]
attrs = [
{file = "attrs-20.2.0-py2.py3-none-any.whl", hash = "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc"},
{file = "attrs-20.2.0.tar.gz", hash = "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594"},
{file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"},
{file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"},
]
certifi = [
{file = "certifi-2020.6.20-py2.py3-none-any.whl", hash = "sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41"},
@ -355,8 +344,8 @@ python-dateutil = [
{file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"},
]
pytz = [
{file = "pytz-2020.1-py2.py3-none-any.whl", hash = "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed"},
{file = "pytz-2020.1.tar.gz", hash = "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048"},
{file = "pytz-2020.4-py2.py3-none-any.whl", hash = "sha256:5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd"},
{file = "pytz-2020.4.tar.gz", hash = "sha256:3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268"},
]
pyyaml = [
{file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"},
@ -397,6 +386,10 @@ pyzmq = [
{file = "pyzmq-19.0.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:654d3e06a4edc566b416c10293064732516cf8871a4522e0a2ba00cc2a2e600c"},
{file = "pyzmq-19.0.2-cp38-cp38-win32.whl", hash = "sha256:276ad604bffd70992a386a84bea34883e696a6b22e7378053e5d3227321d9702"},
{file = "pyzmq-19.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:09d24a80ccb8cbda1af6ed8eb26b005b6743e58e9290566d2a6841f4e31fa8e0"},
{file = "pyzmq-19.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:18189fc59ff5bf46b7ccf5a65c1963326dbfc85a2bc73e9f4a90a40322b992c8"},
{file = "pyzmq-19.0.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:b1dd4cf4c5e09cbeef0aee83f3b8af1e9986c086a8927b261c042655607571e8"},
{file = "pyzmq-19.0.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:c6d653bab76b3925c65d4ac2ddbdffe09710f3f41cc7f177299e8c4498adb04a"},
{file = "pyzmq-19.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:949a219493a861c263b75a16588eadeeeab08f372e25ff4a15a00f73dfe341f4"},
{file = "pyzmq-19.0.2-pp27-pypy_73-macosx_10_9_x86_64.whl", hash = "sha256:c1a31cd42905b405530e92bdb70a8a56f048c8a371728b8acf9d746ecd4482c0"},
{file = "pyzmq-19.0.2-pp36-pypy36_pp73-macosx_10_9_x86_64.whl", hash = "sha256:a7e7f930039ee0c4c26e4dfee015f20bd6919cd8b97c9cd7afbde2923a5167b6"},
{file = "pyzmq-19.0.2.tar.gz", hash = "sha256:296540a065c8c21b26d63e3cea2d1d57902373b16e4256afe46422691903a438"},
@ -421,7 +414,3 @@ win32-setctime = [
{file = "win32_setctime-1.0.3-py3-none-any.whl", hash = "sha256:dc925662de0a6eb987f0b01f599c01a8236cb8c62831c22d9cada09ad958243e"},
{file = "win32_setctime-1.0.3.tar.gz", hash = "sha256:4e88556c32fdf47f64165a2180ba4552f8bb32c1103a2fafd05723a0bd42bd4b"},
]
zmq = [
{file = "zmq-0.0.0.tar.gz", hash = "sha256:6b1a1de53338646e8c8405803cffb659e8eb7bb02fff4c9be62a7acfac8370c9"},
{file = "zmq-0.0.0.zip", hash = "sha256:21cfc6be254c9bc25e4dabb8a3b2006a4227966b7b39a637426084c8dc6901f7"},
]

7
pyproject.toml

@ -1,26 +1,23 @@
[tool.poetry]
name = "zflux"
version = "0.1.0"
version = "0.1.1"
description = ""
authors = ["Benedikt Kristinsson <benedikt@lokun.is>"]
[tool.poetry.dependencies]
python = "^3.8"
zmq = "^0.0.0"
influxdb = "^5.3.0"
loguru = "^0.5.3"
requests = "^2.24.0"
pyyaml = "^5.3.1"
pyzmq = "^19.0.2"
[tool.poetry.scripts]
zflux = "zflux.zflux:main"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
loguru = "^0.5.3"
zmq = "^0.0.0"
requests = "^2.24.0"
[build-system]

Loading…
Cancel
Save