From f14e2468fee5dadb29ad975f02863dda5a488aca Mon Sep 17 00:00:00 2001 From: Jonny Ervine Date: Wed, 19 Feb 2020 06:16:51 +0000 Subject: [PATCH] new file: Dockerfile new file: Jenkinsfile new file: requirements.txt Initial commit --- Dockerfile | 25 +++++++++++++++++++++++++ Jenkinsfile | 17 +++++++++++++++++ requirements.txt | 25 +++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..61a6428 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Base on latest (edge) alpine image +FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11 + +MAINTAINER “Jonathan Ervine” + +# Install updates +ENV LANG='en_US.UTF-8' \ + LANGUAGE='en_US.UTF-8' \ + FLASK_APP=/data/app-dev/app.py + +ADD requirements.txt /tmp/requirements.txt + +RUN apk update +RUN apk -U upgrade +RUN apk -U add python3 gcc python3-dev musl-dev libffi-dev +RUN adduser -D python +RUN pip3 install -r /tmp/requirements.txt + +RUN rm -rf /tmp/src && rm -rf /var/cache/apk/* && rm -f /tmp/requirements.txt + +EXPOSE 3000 + +#USER python + +CMD [ "/usr/bin/flask", "run", "--host=0.0.0.0", "--port=3000" ] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4c58e58 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,17 @@ +node("docker-node") { + docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { + + git branch: "3.11.3", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-alpine-python", credentialsId: 'jenkins-to-git' + + sh "git rev-parse HEAD > .git/commit-id" + def commit_id = readFile('.git/commit-id').trim() + println commit_id + + stage "build" + def app = docker.build "library/x86_64/alpine/python" + + stage "publish" + app.push("${env.BUILD_NUMBER}") + app.push("latest") + } +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d400548 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,25 @@ +attrs +bcrypt +cffi +click +Flask +Flask-Bootstrap +Flask-Bcrypt +Flask-Login +Flask-SQLAlchemy +Flask-WTF +itsdangerous +Jinja2 +MarkupSafe +pluggy +py +pycparser +pytest +six +SQLAlchemy +Werkzeug +WTForms +WTForms-Components +pymysql_sa +Flask-pymysql +flask_table