Commit 454b379c authored by Pietro Saccardi's avatar Pietro Saccardi

Add docker image for running kegtap

parent 7c6442f1
Pipeline #853 failed with stages
in 15 minutes and 10 seconds
......@@ -3,6 +3,7 @@ stages:
- build
- test
- docs
- bundle
.docker-job-definition: &docker-job-template
image: docker:stable
......@@ -36,6 +37,18 @@ build_image:backend-dev:
- pyproject.toml
- poetry.lock
build_image:backend:
<<: *docker-build-template
variables:
BUILD_ARGS: --build-arg DEV=0 --file ./docker/venv.Dockerfile
IMAGE_NAME: backend
only:
changes:
- .gitlab-ci.yml
- docker/venv.Dockerfile
- pyproject.toml
- poetry.lock
build:frontend:
image: node:14
stage: build
......@@ -51,6 +64,16 @@ build:frontend:
expire_in: 7 days
allow_failure: true
build:backend:
image: frederikp/python-poetry-alpine:python3.8-poetry1.0.8
stage: build
script:
- poetry build
artifacts:
paths:
- dist/*.whl
expire_in: 7 days
unit_test:backend:
image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/backend-dev"
stage: test
......@@ -72,6 +95,16 @@ unit_test:frontend:
dependencies:
- build:frontend
bundle:docker:
<<: *docker-build-template
stage: bundle
variables:
BUILD_ARGS: --build-arg BASE="${CI_REGISTRY}/${CI_PROJECT_PATH}/backend" --file ./docker/bundle.Dockerfile
IMAGE_NAME: kegtap
dependencies:
- build:frontend
- build:backend
pages:
image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/backend-dev"
stage: docs
......
ARG BASE=backend-dev
FROM $BASE
COPY dist/*.whl /kt_install/
RUN pip install /kt_install/*.whl && rm -rf /kt_install
EXPOSE 80/tcp
CMD python -m kegtap --host 0.0.0.0 --port 80 /kegtap.toml
......@@ -9,4 +9,4 @@ services:
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
\ No newline at end of file
- 8025:8025
......@@ -25,9 +25,9 @@ internal defaults.
PARSER = ArgumentParser(description=DESCRIPTION, prog='python -m kegtap')
PARSER.add_argument('-d', '--debug', action='store_true', required=False,
help='Enables debug mode in KegTap, FastAPI and Starlette.')
PARSER.add_argument('-H', '--host', required=False, default='localhost',
PARSER.add_argument('-H', '--host', required=False, default='0.0.0.0',
help='Host on which to listen.')
PARSER.add_argument('-P', '--port', type=int, required=False, default=8000,
PARSER.add_argument('-P', '--port', type=int, required=False, default=80,
help='Port on which to listen.')
PARSER.add_argument('-f', '--plugins-folder', required=False,
help='Custom plugin folder.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment