Skip to content
Snippets Groups Projects
Commit dc6a5736 authored by Anton Sarukhanov's avatar Anton Sarukhanov
Browse files

dockerize

parent df9b8fa3
No related branches found
No related tags found
No related merge requests found
Pipeline #165 passed with stages
in 2 minutes and 11 seconds
image: python:3-buster
before_script:
- pip install -r requirements-dev.txt
stages:
- test
- build
analyze:
stage: test
before_script:
- pip install -r requirements-dev.txt
script:
- bandit whatformat/*.py whatformat/util/*.py
- flake8 --config=.flake8 whatformat/*.py whatformat/util/*.py
- mypy whatformat/*.py whatformat/util/*.py
- pydocstyle whatformat/*.py whatformat/util/*.py
- pylint whatformat/*.py whatformat/util/*.py
- bandit whatformat/*.py whatformat/util/*.py
- flake8 --config=.flake8 whatformat/*.py whatformat/util/*.py
- mypy whatformat/*.py whatformat/util/*.py
- pydocstyle whatformat/*.py whatformat/util/*.py
- pylint whatformat/*.py whatformat/util/*.py
test:
stage: test
before_script:
- pip install -r requirements-dev.txt
script:
- python3 -m unittest
- python3 -m unittest
build_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only:
- tags
FROM python:3-buster
WORKDIR /opt/whatformat
COPY / /opt/whatformat
RUN pip install -r /opt/whatformat/requirements.txt
CMD gunicorn -w 4 -b 0.0.0.0:80 whatformat.app:app
EXPOSE 80/tcp
python-dateutil==2.8.1
Flask==1.1.1
Flask-Caching==1.8.0
gunicorn==20.0.4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment