Skip to content

Commit

Permalink
adding themes app for formsflow-ee
Browse files Browse the repository at this point in the history
  • Loading branch information
midhun-aot committed Jul 17, 2023
1 parent 1d4a920 commit 379e522
Show file tree
Hide file tree
Showing 12 changed files with 21,208 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"important-stuff",
"plugin:prettier/recommended"
],
"parser": "@babel/eslint-parser",
"requireConfigFile": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gitignore
.prettierignore
yarn.lock
yarn-error.log
package-lock.json
dist
coverage
pnpm-lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# base image
FROM node:16.20.1-alpine as build-stage

# set working directory
WORKDIR /forms-flow-theme/app


# add `/app/node_modules/.bin` to $PATH
ENV PATH /forms-flow-theme/app/node_modules/.bin:$PATH

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh

# install and cache app dependencies

RUN git clone https://github.com/AOT-Technologies/forms-flow-ai-micro-front-ends.git /tmp/forms-flow-ai/
RUN cp -r /tmp/forms-flow-ai/forms-flow-theme/. /forms-flow-theme/app

COPY package-lock.json /forms-flow-theme/app/package-lock.json
COPY package.json /forms-flow-theme/app/package.json

RUN npm install

COPY . /forms-flow-theme/app/

ARG CUSTOM_SRC_DIR=src
COPY ./ /tmp/${CUSTOM_SRC_DIR}/
RUN cp -R /tmp/${CUSTOM_SRC_DIR}/* /forms-flow-theme/app/ && rm -Rf /tmp/${CUSTOM_SRC_DIR}
RUN ls

RUN npm run build:webpack


FROM nginx:1.15.2-alpine as production-stage

# set label for image
LABEL Name="formsflow"

RUN mkdir /app
COPY --from=build-stage /forms-flow-theme/app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 3008:8080
WORKDIR /usr/share/nginx/html/config
# COPY .env .
RUN apk add --no-cache bash


CMD ["nginx", "-g", "daemon off;"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"presets": [
"@babel/preset-env",
],
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"useESModules": true,
"regenerator": false
}
]
],
"env": {
"test": {
"presets": [
["@babel/preset-env", {
"targets": "current node"
}]
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
forms-flow-theme:
container_name: forms-flow-theme
build:
context: .
dockerfile: Dockerfile
ports:
- "3008:8080"
tty: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
testEnvironment: "jsdom",
transform: {
"^.+\\.(j|t)sx?$": "babel-jest",
},
moduleNameMapper: {
"\\.(css)$": "identity-obj-proxy",
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# nginx.conf
worker_processes auto;
error_log /var/log/nginx/error.log;

pid /tmp/nginx.pid;


events {
worker_connections 4096;
}

http {
include /etc/nginx/mime.types;
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
default_type application/octet-stream;
server_tokens off;
underscores_in_headers on;

# Use a w3c standard log format
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;


server {

# add in most common security headers
add_header Content-Security-Policy "default-src * data: blob: filesystem: 'unsafe-inline' 'unsafe-eval'";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection 1;
add_header X-Frame-Options SAMEORIGIN;



listen 8080;
server_name _;

index index.html;
error_log /dev/stdout info;
access_log /dev/stdout;

location / {
add_header 'Access-Control-Allow-Origin' '*';
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /usr/share/nginx/html;
}
}
}
Loading

0 comments on commit 379e522

Please sign in to comment.