Initial commit

leonid98
Lauri Võsandi 10 months ago
commit 6c0fbe6efc
  1. 16
      .drone.yml
  2. 6
      .flake8
  3. 1
      .gitignore
  4. 9
      .gitlint
  5. 16
      .pre-commit-config.yaml
  6. 7
      Dockerfile
  7. 29
      README.md
  8. 27
      docker-compose.yml
  9. 2
      main.py

@ -0,0 +1,16 @@
---
kind: pipeline
type: kubernetes
name: default
steps:
- name: docker
image: plugins/docker
settings:
repo: harbor.k-space.ee/${DRONE_REPO}
registry: harbor.k-space.ee
mtu: 1300
username:
from_secret: docker_username
password:
from_secret: docker_password

@ -0,0 +1,6 @@
[flake8]
inline-quotes = "
multiline-quotes = """
indent-size = 4
max-line-length = 160
ignore = Q003 E128 E704 E731

1
.gitignore vendored

@ -0,0 +1 @@
*.save

@ -0,0 +1,9 @@
[general]
ignore=body-is-missing,T3
ignore-stdin=true
[title-match-regex]
regex=[A-Z]
[author-valid-email]
regex=[^@]+@k-space.ee

@ -0,0 +1,16 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.10.0,flake8-quotes==3.2.0]
- repo: https://github.com/jorisroovers/gitlint
rev: v0.15.1
hooks:
- id: gitlint
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.1
hooks:
- id: dockerfile_lint

@ -0,0 +1,7 @@
FROM python:alpine
LABEL name="k-space/microscript-skeleton" \
version="rc" \
maintainer="Lauri Võsandi <lauri@k-space.ee>"
RUN pip install pymongo
ADD main.py /main.py
CMD /main.py

@ -0,0 +1,29 @@
# Introduction
This repository is a skeleton for a microscript container image -- that
is container that get's started either by Kubernetes Job or CronJob and
that does not run forever.
In this particular example MongoDB is included in the setup.
# How to use this repository
* Fork with suitable name under `k-space` organization
* Adjust maintainer name and e-mail in `Dockerfile
* Add/remove dependencies as necessary in `Dockerfile`
* Make sure `docker-compose.yml` brings up sensible development environment
# Prerequisites
* Docker runtime is installed
* Your user is user of group `docker`
* Docker compose is installed
* Pre-commit framework is installed, if necessary `apt-get install pre-commit`
# Development environment
```
docker-compose up --build
```
To access MongoExpress open up http://localhost:8081/

@ -0,0 +1,27 @@
version: '3.7'
services:
main:
build:
context: .
mongo:
logging:
driver: none
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
mongo-express:
logging:
driver: none
image: mongo-express
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
ME_CONFIG_MONGODB_URL: mongodb://root:example@mongo:27017/

@ -0,0 +1,2 @@
#!/usr/bin/env python
print("Hello world")
Loading…
Cancel
Save