Compare commits

..

7 Commits

Author SHA1 Message Date
cb8b605383 first working release
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-20 15:22:14 +02:00
a39cf380a4 update repo before install
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-20 14:58:20 +02:00
775d6829e7 move apk to apt-get
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-20 14:57:28 +02:00
3fbd1a36db testing on debian based image
Some checks failed
continuous-integration/drone Build is failing
2022-04-20 14:51:31 +02:00
83596ea7bb fix docker passwd
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-20 12:44:07 +02:00
47b2a355cb change drone config
Some checks failed
continuous-integration/drone Build is failing
2022-04-20 11:35:25 +02:00
ea33ecd589 not working, numpy related failure 2022-04-20 11:06:38 +02:00
4 changed files with 82 additions and 1 deletions

13
.drone.yml Normal file
View File

@ -0,0 +1,13 @@
---
kind: pipeline
name: publish docker image
steps:
- name: build and publish
image: plugins/docker
settings:
username:
from_secret: docker_reg_username
password:
from_secret: docker_reg_passwd
repo: autonomiccooperative/capsul-flask
tags: ${DRONE_COMMIT_BRANCH}

32
Dockerfile Normal file
View File

@ -0,0 +1,32 @@
FROM python:3.8-slim as build
RUN apt-get update && apt-get install --no-install-recommends -y \
gcc \
gettext \
git \
libffi-dev \
# postgresql \
python3-dev \
libpq-dev
RUN mkdir -p /app/{code,venv}
WORKDIR /app/code
COPY Pipfile Pipfile.lock /app/code/
RUN python3 -m venv /app/venv
RUN pip install pipenv setuptools
ENV PATH="/app/venv/bin:$PATH" VIRTUAL_ENV="/app/venv"
RUN pip install wheel cppy
# Install dependencies into the virtual environment with Pipenv
RUN pipenv install --deploy --verbose
FROM python:3.8-slim
RUN apt-get update && apt-get install --no-install-recommends -y \
cloud-utils \
libpq5 \
libvirt-clients \
openssh-client \
virtinst
COPY . /app/code/
WORKDIR /app/code
COPY --from=build /app/venv /app/venv
ENV PATH="/app/venv/bin:$PATH" VIRTUAL_ENV="/app/venv"
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "-k", "gevent", "--worker-connections", "1000", "app:app"]
VOLUME /app/code
EXPOSE 5000

View File

@ -4,6 +4,7 @@ verify_ssl = true
name = "pypi" name = "pypi"
[packages] [packages]
psycopg2 = "==2.8.5"
astroid = "==2.4.1" astroid = "==2.4.1"
blinker = "==1.4" blinker = "==1.4"
click = "==7.1.2" click = "==7.1.2"
@ -17,7 +18,6 @@ lazy-object-proxy = "==1.4.3"
MarkupSafe = "==1.1.1" MarkupSafe = "==1.1.1"
mccabe = "==0.6.1" mccabe = "==0.6.1"
nanoid = "==2.0.0" nanoid = "==2.0.0"
psycopg2 = "==2.8.5"
pylint = "==2.5.2" pylint = "==2.5.2"
six = "==1.14.0" six = "==1.14.0"
toml = "==0.10.0" toml = "==0.10.0"

36
docker-compose.yml Normal file
View File

@ -0,0 +1,36 @@
---
version: "3.6"
services:
app:
image: kn0fl00k/capsul:latest
build: .
volumes:
- "./:/app/code"
- "../tank:/tank"
# - "/var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock"
depends_on:
- db
ports:
- "5000:5000"
environment:
- "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul"
- SPOKE_MODEL=shell-scripts
#- FLASK_DEBUG=1
- BASE_URL=http://localhost:5000
- ADMIN_PANEL_ALLOW_EMAIL_ADDRESSES=3wc.capsul@doesthisthing.work
- VIRSH_DEFAULT_CONNECT_URI=qemu:///system
# The image uses gunicorn by default, let's override it with Flask's
# built-in development server
command: ["flask", "run", "-h", "0.0.0.0", "-p", "5000"]
db:
image: "postgres:14-alpine"
volumes:
- "postgres:/var/lib/postgresql/data"
environment:
POSTGRES_USER: capsul
POSTGRES_PASSWORD: capsul
POSTGRES_DB: capsul
volumes:
postgres: