Skip to content

Commit debbb5d

Browse files
committed
3.0.0
1 parent 8ce6699 commit debbb5d

File tree

339 files changed

+51709
-1235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+51709
-1235
lines changed

.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"presets": [
3+
[
4+
"next/babel",
5+
{
6+
"preset-react": {
7+
"runtime": "automatic",
8+
"importSource": "@emotion/react"
9+
}
10+
}
11+
]
12+
],
13+
"plugins": ["@emotion/babel-plugin"]
14+
}

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Dockerfile*.*
2+
.dockerignore
3+
node_modules
4+
yarn-error.log
5+
README.md
6+
.env
7+
.env.local
8+
.env.test
9+
.env.development
10+
.yarnrc
11+
__ENV.js

.env.development

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PORT=3000
2+
HOST=http://localhost:$PORT
3+
REACT_APP_APOLLO_URL=http://localhost:1300
4+
IMAGE_DOMAIN=localhost
5+
REACT_APP_MEDIA_BASE_URL=http://localhost:1337
6+
REACT_APP_RUNTIME_ENV=dev
7+
HEALTHCHECK_SECRET=1234
8+
LOGGING_LEVELS=warn,error,info

.env.production

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Env for all container builds. env vars set here can be overrided in docker runtime
2+
3+
REACT_APP_MEDIA_BASE_URL=http://localhost:1337
4+
REACT_APP_RUNTIME_ENV=prod
5+
6+
#DONT SET APOLLO URL HERE, will break ASI in the container! Send via container run instead
7+
#REACT_APP_APOLLO_URL=

.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": "next/core-web-vitals",
3+
"rules": {
4+
//"no-console": ["error", { "allow": ["warn", "error"] }],
5+
"react-hooks/exhaustive-deps": "off",
6+
"@next/next/no-sync-scripts" : "off"
7+
8+
}
39
}

.github/workflows/azure.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
workflow_dispatch
3+
4+
name: Azure - dataportal build/push image
5+
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
environment: test
10+
steps:
11+
12+
- name: 'Login via Azure CLI'
13+
uses: azure/login@v1
14+
with:
15+
creds: ${{ secrets.AZURE_CREDENTIALS }}
16+
17+
- name: 'Checkout GitHub Action'
18+
uses: actions/checkout@master
19+
20+
- name: Extract branch name
21+
shell: bash
22+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
23+
id: extract_branch
24+
25+
- name: 'Docker login'
26+
uses: azure/docker-login@v1
27+
with:
28+
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
29+
username: ${{ secrets.REGISTRY_USERNAME }}
30+
password: ${{ secrets.REGISTRY_PASSWORD }}
31+
32+
- name: get-npm-version
33+
id: package-version
34+
uses: martinbeentjes/npm-get-version-action@main
35+
36+
- name: Print docker version tag
37+
run: |
38+
echo "${{ secrets.REGISTRY_LOGIN_SERVER }}/digg-dataportal:${{ steps.package-version.outputs.current-version}}-b.${{ github.run_number }}"
39+
40+
- name: Print commits url
41+
run: |
42+
echo "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
43+
44+
- name: build_publish_image
45+
uses: docker/build-push-action@v2
46+
with:
47+
context: .
48+
file: ./Dockerfile
49+
push: true
50+
tags: ${{ secrets.REGISTRY_LOGIN_SERVER }}/digg-dataportal:latest,${{ secrets.REGISTRY_LOGIN_SERVER }}/digg-dataportal:${{ steps.package-version.outputs.current-version}}-b.${{ github.run_number }},${{ secrets.REGISTRY_LOGIN_SERVER }}/digg-dataportal:${{ github.sha }},${{ secrets.REGISTRY_LOGIN_SERVER }}/digg-dataportal:branch-${{ steps.extract_branch.outputs.branch }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
310
# dependencies
411
/node_modules
512
/.pnp
@@ -23,8 +30,10 @@
2330
npm-debug.log*
2431
yarn-debug.log*
2532
yarn-error.log*
33+
*.log
2634

2735
# local env files
36+
.env
2837
.env.local
2938
.env.development.local
3039
.env.test.local
@@ -35,3 +44,5 @@ yarn-error.log*
3544

3645
# typescript
3746
*.tsbuildinfo
47+
48+
__ENV.js

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "es5",
3+
"printWidth": 100,
4+
"singleAttributePerLine": true,
5+
"singleQuote": true
6+
}

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM node:16-alpine as base
2+
WORKDIR /base
3+
COPY package.json yarn.lock ./
4+
RUN yarn install --frozen-lockfile
5+
6+
FROM node:16-alpine as builder
7+
WORKDIR /build
8+
COPY . .
9+
COPY --from=base /base ./
10+
RUN yarn build
11+
12+
FROM node:16-alpine as production
13+
ENV NODE_ENV=production
14+
15+
WORKDIR /app
16+
17+
COPY --from=builder /build/next.config.js ./
18+
COPY --from=builder /build/i18n.js ./
19+
COPY --from=builder /build/public ./public
20+
COPY --from=builder /build/.next ./.next
21+
COPY --from=builder /build/node_modules ./node_modules
22+
COPY --from=builder /build/package.json ./package.json
23+
COPY --from=builder /build/locales ./locales
24+
25+
COPY --from=builder /build/pages ./pages
26+
COPY --from=builder /build/.env.production ./.env.production
27+
COPY --from=builder /build/entrypoint.sh /usr/local/bin/entrypoint.sh
28+
29+
ENV NEXT_TELEMETRY_DISABLED 1
30+
31+
RUN chmod +x /usr/local/bin/entrypoint.sh
32+
ENTRYPOINT ["entrypoint.sh"]
33+
34+
#OpenShift specific
35+
RUN chgrp -R 0 /app && \
36+
chmod -R g=u /app
37+
USER 1001
38+
39+
CMD ["yarn","start"]

LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2020, DIGGSweden
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)