main Dockerfile, CI config

This commit is contained in:
Jörn-Michael Miehe 2022-09-20 00:55:52 +02:00
parent 4b37075007
commit a0fb8fcc1c
3 changed files with 82 additions and 0 deletions

26
.dockerignore Normal file
View file

@ -0,0 +1,26 @@
# commonly found
**/.git
**/.idea
**/.DS_Store
**/.vscode
**/.devcontainer
**/dist
**/.gitignore
**/Dockerfile
**/.dockerignore
# found in python and JS dirs
**/__pycache__
**/node_modules
# env files
**/.env
**/.env.local
**/.env.*.local
# log files
**/npm-debug.log*
**/yarn-debug.log*
**/yarn-error.log*
**/pnpm-debug.log*

14
.drone.yml Normal file
View file

@ -0,0 +1,14 @@
---
kind: pipeline
name: default
steps:
- name: ovdashboard
image: plugins/docker
settings:
repo: ldericher/ovdashboard
auto_tag: true
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD

42
Dockerfile Normal file
View file

@ -0,0 +1,42 @@
############
# build ui #
############
FROM node:lts-alpine AS build-ui
# some dir for our code
WORKDIR /app
# install dependencies
COPY ui/package*.json ui/yarn*.lock ./
RUN yarn --production=false
# copy code
COPY ui .
RUN yarn build
##############
# webservice #
##############
FROM antonapetrov/uvicorn-gunicorn:python3.9-alpine3.13 AS production
RUN set -ex; \
# prerequisites
apk add --no-cache \
libmagic \
;
# env setup
ENV \
PRODUCTION_MODE="true" \
APP_MODULE="ovdashboard_api:app"
# install API
COPY api /usr/src/ovdashboard_api
RUN set -ex; \
pip3 --no-cache-dir install /usr/src/ovdashboard_api;
# install UI
COPY --from=build-ui /app/dist /html