Skip to content

Commit

Permalink
feat: create docker deployment setup
Browse files Browse the repository at this point in the history
* Create PR for #27

* chore: base docker compose with db

* chore: minor change

* chore: create Dockerfile

* chore: change docker-compose file

* feat: use nginx as web server

* fix: fix media conf

* fix: use template for nginx config

* chore: update env example

* chore: setup docker action

* chore: test workflow

* chore: test docker metadata

* chore: test docker build

* chore: test docker push

* fix: make entrypoint executable

* fix: update compose

* fix: update action

* chore: add release creation to action

* chore: use specific versions in compose

Co-authored-by: sbanoeon <sbanoeon@users.noreply.github.com>
Co-authored-by: Saira Bano <saira.bano@eonerc.rwth-aachen.de>
Co-authored-by: JunsongDu <junsong.du@eonerc.rwth-aachen.de>
Co-authored-by: dnikolay-ebc <daniel.nikolay@rwth-aachen.de>
  • Loading branch information
5 people authored Sep 1, 2022
1 parent 6216394 commit 8eb29da
Show file tree
Hide file tree
Showing 19 changed files with 451 additions and 267 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore in language detection
app/Entirety/static/bootstrap/** linguist-vendored
app/Entirety/static/htmx/** linguist-vendored


*.sh text eol=lf
45 changes: 45 additions & 0 deletions .github/workflows/create-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create Docker Image

on:
push:
branches:
- development
release:
types:
- created

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.CI_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,5 @@ fabric.properties
.idea

app/Entirety/static/CACHE/
app/Entirety/**/migrations/
app/Entirety/**/migrations/*
!app/Entirety/**/migrations/__init__.py
56 changes: 31 additions & 25 deletions app/Entirety/.env.EXAMPLE
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# Django
DJANGO_SECRET_KEY=
DJANGO_DEBUG=False
ALLOWED_HOSTS=["localhost","127.0.0.1"]
LANGUAGE_CODE=en-us
TIME_ZONE=Europe/Berlin

# JS/SCSS compression
COMPRESS_ENABLED=True

# OIDC
LOGIN_URL=/oidc/authenticate
LOGIN_REDIRECT_URL=/oidc/callback/
LOGOUT_REDIRECT_URL=/
OIDC_OP_AUTHORIZATION_ENDPOINT=
OIDC_OP_JWKS_ENDPOINT=
OIDC_OP_TOKEN_ENDPOINT=
OIDC_OP_USER_ENDPOINT=
OIDC_RP_CLIENT_ID=
OIDC_RP_CLIENT_SECRET=
OIDC_SUPER_ADMIN_ROLE=super_admin
OIDC_SERVER_ADMIN_ROLE=server_admin
OIDC_PROJECT_ADMIN_ROLE=project_admin
OIDC_USER_ROLE=user
OIDC_TOKEN_ROLE_FIELD=roles
# Django
DJANGO_SECRET_KEY=
DJANGO_DEBUG=False
ALLOWED_HOSTS=["localhost","127.0.0.1"]
LANGUAGE_CODE=en-us
TIME_ZONE=Europe/Berlin

# JS/SCSS compression
COMPRESS_ENABLED=True

# Static files location
STATIC_ROOT=/var/entirety/static/
MEDIA_ROOT=/var/entirety/media/

# OIDC
LOGIN_URL=/oidc/authenticate
LOGIN_REDIRECT_URL=/oidc/callback/
LOGOUT_REDIRECT_URL=/
OIDC_OP_AUTHORIZATION_ENDPOINT=
OIDC_OP_JWKS_ENDPOINT=
OIDC_OP_TOKEN_ENDPOINT=
OIDC_OP_USER_ENDPOINT=
OIDC_RP_CLIENT_ID=
OIDC_RP_CLIENT_SECRET=
OIDC_SUPER_ADMIN_ROLE=super_admin
OIDC_SERVER_ADMIN_ROLE=server_admin
OIDC_PROJECT_ADMIN_ROLE=project_admin
OIDC_USER_ROLE=user
OIDC_TOKEN_ROLE_FIELD=roles

WEB_URL=localhost
Empty file.
1 change: 1 addition & 0 deletions app/Entirety/alarming/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from alarming.views import SubscriptionList

app_name = "alarming"
urlpatterns = [
path("subscriptions/", SubscriptionList.as_view(), name="subscriptions"),
path("", RedirectView.as_view(pattern_name="subscriptions")),
Expand Down
Empty file.
Loading

0 comments on commit 8eb29da

Please sign in to comment.