Skip to content

Commit

Permalink
Merge pull request #9 from samply/release-1.0.0
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
djuarezgf committed Dec 13, 2023
2 parents f6cdc4d + 7a05572 commit 6696383
Show file tree
Hide file tree
Showing 24 changed files with 22,823 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dist
.env
### Example user template template
### Example user template

# IntelliJ project files
.idea
*.iml
out
gen
.github
.husky
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TEILER_BACKEND_URL=
TEILER_DASHBOARD_URL=
DEFAULT_LANGUAGE=
HTTP_RELATIVE_PATH=
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["ts-important-stuff"],
"parser": "@babel/eslint-parser",
"rules": {
"linebreak-style": 0
}
}
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker CI

on:
push:
branches:
- main
- develop
# Build then a new version is tagged
tags:
- '*.*.*'
pull_request:
branches:
- main
- develop
schedule:
# Build every night at 1am
- cron: '0 1 * * *'
jobs:
build:
uses: samply/github-workflows/.github/workflows/docker-ci.yml@main
with:
# The Docker Hub Repository you want eventually push to, e.g samply/share-client
image-name: "samply/teiler-orchestrator"
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
dist

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.DS_Store
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm exec pretty-quick --staged && npm exec concurrently npm:test npm:lint
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.gitignore
.prettierignore
yarn.lock
yarn-error.log
package-lock.json
LICENSE
*.ejs
dist
coverage
pnpm-lock.yaml
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.0 - 2023-12-13]
### Added
- First version
- Teiler core config
- React support
- Teiler UI title
- Multi-language support for teiler-ui
- Generate single-spa-router from teiler-core import-map
- Docker ignore
- Rename Teiler Orchestrator, Teiler Dashboard and Teiler Backend
- Main in Docker CI

## Changed
- Title
- Rename developer to develop
- Rename: Teiler Orchestrator

## Fixed
- Show env.js of teiler-ui in html head
- Add http relative path (compatibility with traefik)
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 1st Stage: Build project
FROM node:alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
COPY docker/.env.template ./.env
#RUN rm -f ./.env
RUN npm run build


# 2nd Stage: Create nginx image with built project
FROM nginx:alpine

### Install bash
RUN apk update
RUN apk upgrade
RUN apk add bash

### Configuration of NGINX
COPY docker/nginx.conf /etc/nginx/nginx.conf


EXPOSE 9000
WORKDIR /usr/share/nginx/html
COPY --from=build /app/dist .


ADD docker/start.sh /samply/
RUN chmod +x /samply/start.sh

CMD ["/samply/start.sh"]
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# teiler-root-config
Single SPA root config project for Teiler UI
# teiler-orchestrator
Single-SPA root-config project for Teiler UI

## Docker
docker build -t teiler-orchestrator .
docker run teiler-orchestrator
24 changes: 24 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"useESModules": true,
"regenerator": false
}
]
],
"env": {
"test": {
"presets": [
["@babel/preset-env", {
"targets": "current node"
}]
]
}
}
}
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3"

services:

test-orchestrator:
# image: test-orchestrator
build: .

# depends_on:
# - teiler-backend
ports:
- 9000:9000
environment:
TEILER_BACKEND_URL: "http://localhost:8085"
TEILER_DASHBOARD_URL: "http://localhost:4200"
DEFAULT_LANGUAGE: "de"

# teiler-backend :
# image: teiler-backend
5 changes: 5 additions & 0 deletions docker/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# import map json url
TEILER_BACKEND_URL=${TEILER_BACKEND_URL}
TEILER_DASHBOARD_URL=${TEILER_DASHBOARD_URL}
DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE}
HTTP_RELATIVE_PATH=${HTTP_RELATIVE_PATH}
35 changes: 35 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
worker_processes 1;

events {
worker_connections 1024;
}

http {
server {
listen 9000;
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;

gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}

location ^~ /config/ {
add_header Cache-Control "no-cache";
add_header X-Content-Type-Options nosniff;
}

location ~ \.(css|js)$ {
expires max;
add_header Cache-Control "public";
add_header X-Content-Type-Options nosniff;
}
}
}
9 changes: 9 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

envsubst < index.html > temp.html
mv temp.html index.html
envsubst < samply-root-config.js > temp-samply-root-config.js
mv temp-samply-root-config.js samply-root-config.js

echo 'Start Root Config in NGINX in foreground (non-daemon-mode)'
exec nginx -g 'daemon off;'
Loading

0 comments on commit 6696383

Please sign in to comment.