-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #453 from City-of-Helsinki/develop
Develop to master
- Loading branch information
Showing
338 changed files
with
29,087 additions
and
6,609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Required | ||
API_URL=https://mvj.dev.hel.ninja/v1 | ||
STORAGE_PREFIX=MVJ | ||
|
||
PORT=3000 | ||
# The SSO OpenId Connect settings | ||
OPENID_CONNECT_API_TOKEN_KEY=https://api.hel.fi/auth/mvj | ||
OPENID_CONNECT_API_TOKEN_URL=https://api.hel.fi/sso/api-tokens/ | ||
OPENID_CONNECT_AUTHORITY_URL=https://api.hel.fi/sso/openid/ | ||
OPENID_CONNECT_CLIENT_ID= | ||
OPENID_CONNECT_SCOPE=openid profile https://api.hel.fi/auth/mvj | ||
OPENID_CONNECT_CLIENT_ID=https://api.hel.fi/auth/mvj | ||
OPENID_CONNECT_SCOPE=openid profile mvj https://api.hel.fi/auth/mvj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
on: | ||
push: | ||
branches: [master, develop] | ||
pull_request: | ||
branches: [master, develop] | ||
|
||
name: Sonarcloud Scan | ||
jobs: | ||
sonarcloud: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: SonarCloud Scan | ||
uses: sonarsource/sonarcloud-github-action@master | ||
with: | ||
args: > | ||
-Dsonar.organization=managedcloudapplications | ||
-Dsonar.projectKey=mvj-ui | ||
-Dsonar.sources=. | ||
-Dsonar.host.url=https://sonarcloud.io | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,6 @@ npm-debug.log | |
/log | ||
|
||
report.*.json | ||
|
||
docker-compose.override.yml | ||
docker-compose.dev.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
pid /tmp/nginx.pid; | ||
|
||
events { | ||
worker_connections 4096; ## Default: 1024 | ||
} | ||
http { | ||
#for running as non-root | ||
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; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
server { | ||
listen 8080; | ||
server_name localhost; | ||
|
||
location /healthz { | ||
return 200 'OK'; | ||
} | ||
|
||
location /readiness { | ||
return 200 'OK'; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri /index.html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,90 @@ | ||
FROM node:10.15 | ||
# =============================================== | ||
FROM node:14-slim AS appbase | ||
# =============================================== | ||
|
||
RUN groupadd -g 1001 appuser \ | ||
&& useradd --create-home --no-log-init -u 1001 -g 1001 appuser | ||
|
||
RUN mkdir /app | ||
RUN chown -R appuser:appuser /app | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install && yarn cache clean --force | ||
# Offical image has npm log verbosity as info. More info - https://github.com/nodejs/docker-node#verbosity | ||
ENV NPM_CONFIG_LOGLEVEL warn | ||
|
||
# set our node environment, either development or production | ||
# defaults to production, compose overrides this to development on build and run | ||
ARG NODE_ENV=production | ||
ENV NODE_ENV $NODE_ENV | ||
|
||
# Global npm deps in a non-root user directory | ||
ENV NPM_CONFIG_PREFIX=/app/.npm-global | ||
ENV PATH=$PATH:/app/.npm-global/bin | ||
|
||
# Yarn | ||
ENV YARN_VERSION 1.22.19 | ||
RUN yarn policies set-version $YARN_VERSION | ||
|
||
# Use non-root user | ||
USER appuser | ||
|
||
# Copy package.json and package-lock.json/yarn.lock files | ||
COPY package*.json *yarn* ./ | ||
|
||
# Install npm depepndencies | ||
ENV PATH /app/node_modules/.bin:$PATH | ||
|
||
USER root | ||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends build-essential python3 | ||
|
||
USER appuser | ||
RUN yarn config set network-timeout 300000 | ||
RUN yarn && yarn cache clean --force | ||
|
||
USER root | ||
RUN apt-get remove -y build-essential | ||
RUN apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false | ||
RUN rm -rf /var/lib/apt/lists/* | ||
RUN rm -rf /var/cache/apt/archives | ||
|
||
# ============================= | ||
FROM appbase as development | ||
# ============================= | ||
|
||
# Set NODE_ENV to development in the development container | ||
ARG NODE_ENV=development | ||
ENV NODE_ENV $NODE_ENV | ||
|
||
# copy in our source code last, as it changes the most | ||
COPY --chown=appuser:appuser . . | ||
|
||
# Bake package.json start command into the image | ||
CMD ["react-scripts", "start"] | ||
|
||
# =================================== | ||
FROM appbase as staticbuilder | ||
# =================================== | ||
|
||
COPY . /app | ||
RUN yarn compile | ||
|
||
# ============================= | ||
FROM registry.access.redhat.com/ubi8/nginx-120 as production | ||
# ============================= | ||
|
||
USER root | ||
|
||
RUN chgrp -R 0 /usr/share/nginx/html && \ | ||
chmod -R g=u /usr/share/nginx/html | ||
|
||
# Copy static build | ||
COPY --from=staticbuilder /app/dist /usr/share/nginx/html | ||
|
||
COPY . . | ||
# Copy nginx config | ||
COPY .prod/nginx.conf /etc/nginx/ | ||
|
||
VOLUME [ "/app" ] | ||
EXPOSE 8080 | ||
|
||
CMD ["yarn", "start"] | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:10.15 | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install && yarn cache clean --force | ||
|
||
COPY . . | ||
|
||
VOLUME [ "/app" ] | ||
|
||
CMD ["yarn", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// @flow | ||
|
||
declare module 'react-leaflet' { | ||
declare module.exports: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
version: '3' | ||
services: | ||
app: | ||
build: . | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
env_file: | ||
- .env | ||
ports: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"$assets/*": ["./assets/*"], | ||
"$components/*": ["./src/components/*"], | ||
"$src/*": ["./src/*"], | ||
"$util/*": ["./src/util/*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.