Skip to content

Commit 0e4e4f5

Browse files
committed
Implementerer hotbff og fjerner gammelt oppsett, deployer til dev
1 parent 2a9242d commit 0e4e4f5

32 files changed

+107
-7964
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- 'CODEOWNERS'
99
branches:
1010
- main
11+
- hotbff
1112

1213
jobs:
1314
build:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
dist
33
node_modules
44
*.iml
5+
server/server

.nais/dev.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ spec:
1212
ingresses:
1313
- https://brilleavtale.intern.dev.nav.no/hjelpemidler/brilleavtale
1414
liveness:
15-
path: /hjelpemidler/brilleavtale/internal/isalive
15+
path: /isalive
1616
readiness:
17-
path: /hjelpemidler/brilleavtale/internal/isready
17+
path: /isready
1818
prometheus:
19-
enabled: true
20-
path: /hjelpemidler/brilleavtale/internal/metrics
19+
enabled: false
20+
path: /metrics
2121
replicas:
2222
max: 1
2323
min: 1
@@ -41,9 +41,7 @@ spec:
4141
- name: BRILLE_API_BASE_URL
4242
value: 'http://hm-brille-api.teamdigihot.svc.cluster.local'
4343
- name: BRILLE_API_TARGET_AUDIENCE
44-
value: dev-gcp:teamdigihot:hm-brille-api
45-
- name: PORT
46-
value: '5000'
44+
value: api://dev-gcp:teamdigihot:hm-brille-api/.default
4745
- name: GIT_COMMIT
4846
value: {{commit}}
4947
accessPolicy:

.nais/labs.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ spec:
1212
ingresses:
1313
- https://brilleavtale-labs.ekstern.dev.nav.no/hjelpemidler/brilleavtale
1414
liveness:
15-
path: /hjelpemidler/brilleavtale/internal/isalive
15+
path: /isalive
1616
readiness:
17-
path: /hjelpemidler/brilleavtale/internal/isready
17+
path: /isready
1818
prometheus:
19-
enabled: true
20-
path: /hjelpemidler/brilleavtale/internal/metrics
19+
enabled: false
20+
path: /metrics
2121
replicas:
2222
max: 1
2323
min: 1
@@ -29,14 +29,10 @@ spec:
2929
cpu: 20m
3030
memory: 256Mi
3131
env:
32-
- name: IS_LABS
33-
value: 'true'
3432
- name: BRILLE_API_BASE_URL
3533
value: ''
3634
- name: BRILLE_API_TARGET_AUDIENCE
3735
value: ''
38-
- name: PORT
39-
value: '5000'
4036
- name: USE_MSW
4137
value: 'true'
4238
- name: GIT_COMMIT

.nais/prod.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ spec:
1212
ingresses:
1313
- https://www.nav.no/hjelpemidler/brilleavtale
1414
liveness:
15-
path: /hjelpemidler/brilleavtale/internal/isalive
15+
path: /isalive
1616
readiness:
17-
path: /hjelpemidler/brilleavtale/internal/isready
17+
path: /isready
1818
prometheus:
19-
enabled: true
20-
path: /hjelpemidler/brilleavtale/internal/metrics
19+
enabled: false
20+
path: /metrics
2121
replicas:
2222
max: 2
2323
min: 2
@@ -41,9 +41,7 @@ spec:
4141
- name: BRILLE_API_BASE_URL
4242
value: 'http://hm-brille-api.teamdigihot.svc.cluster.local'
4343
- name: BRILLE_API_TARGET_AUDIENCE
44-
value: prod-gcp:teamdigihot:hm-brille-api
45-
- name: PORT
46-
value: '5000'
44+
value: api://prod-gcp:teamdigihot:hm-brille-api/.default
4745
- name: GIT_COMMIT
4846
value: {{commit}}
4947
accessPolicy:

Dockerfile

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,30 @@
1-
FROM node:20.14.0-alpine as node
1+
FROM node:lts-alpine AS node
22
RUN --mount=type=secret,id=NODE_AUTH_TOKEN \
33
npm config set //npm.pkg.github.com/:_authToken=$(cat /run/secrets/NODE_AUTH_TOKEN)
44
RUN npm config set @navikt:registry=https://npm.pkg.github.com
55

66
# build client
7-
FROM node as client-builder
7+
FROM node AS client-builder
88
WORKDIR /app
99
COPY client/package.json client/package-lock.json ./
1010
RUN npm ci
1111
COPY client .
1212
RUN npm run build
1313

1414
# build server
15-
FROM node as server-builder
15+
FROM golang:1.25.1-alpine AS server-builder
1616
WORKDIR /app
17-
COPY server/package.json server/package-lock.json ./
18-
RUN npm ci
19-
COPY server .
20-
RUN npm run build
21-
22-
# install server dependencies
23-
FROM node as server-dependencies
24-
WORKDIR /app
25-
COPY server/package.json server/package-lock.json ./
26-
RUN npm ci --omit dev
17+
COPY server ./
18+
RUN go build .
2719

2820
# runtime
29-
FROM gcr.io/distroless/nodejs20-debian12 as runtime
21+
FROM gcr.io/distroless/static-debian12 AS runtime
3022
WORKDIR /app
3123

32-
ARG NODE_ENV=production
33-
ENV NODE_ENV=${NODE_ENV}
3424
ENV TZ="Europe/Oslo"
35-
EXPOSE 3000
36-
37-
COPY --from=client-builder /app/dist ./client/dist
38-
COPY --from=server-builder /app/dist ./server/dist
39-
40-
WORKDIR /app/server
25+
EXPOSE 5000
4126

42-
COPY --from=server-dependencies /app/node_modules ./node_modules
27+
COPY --from=client-builder /app/dist ./dist
28+
COPY --from=server-builder /app/hm-brilleavtale-frontend .
4329

44-
CMD [ "--enable-source-maps", "-r", "dotenv/config", "dist/server.mjs" ]
30+
CMD [ "./hm-brilleavtale-frontend" ]

client/index.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<!DOCTYPE html>
22
<html lang="no">
3+
34
<head>
45
<meta charset="utf-8" />
56
<link rel="icon" href="/favicon.ico" />
67
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
{{{DECORATOR_STYLES}}}
8+
{{.HeadAssets}}
89
<title>NAV Brilleavtale</title>
910
</head>
11+
1012
<body>
11-
<noscript>You need to enable JavaScript to run this app.</noscript>
12-
{{{DECORATOR_HEADER}}}
13-
<div id="root"></div>
14-
{{{DECORATOR_FOOTER}}}
15-
{{{DECORATOR_SCRIPTS}}}
16-
<script type="module" src="/src/main.tsx"></script>
13+
<noscript>You need to enable JavaScript to run this app.</noscript>
14+
{{.Header}}
15+
<div id="root"></div>
16+
{{.Footer}}
17+
{{.Scripts}}
18+
<script type="module" src="/src/main.tsx"></script>
1719
</body>
18-
</html>
20+
21+
</html>

client/src/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interface Window {
22
appSettings: {
33
GIT_COMMIT?: string
4-
MILJO?: 'labs-gcp' | 'dev-gcp' | 'prod-gcp'
4+
NAIS_CLUSTER_NAME?: 'labs-gcp' | 'dev-gcp' | 'prod-gcp'
55
USE_MSW?: boolean
66
}
77
}

client/vite.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const htmlPlugin = ({ development }: { development?: boolean }): Plugin => ({
3030
tag: 'script',
3131
children: `window.appSettings = {
3232
GIT_COMMIT: 'ukjent',
33-
MILJO: 'labs-gcp',
33+
NAIS_CLUSTER_NAME: 'labs-gcp',
3434
USE_MSW: true,
3535
}`,
3636
},

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
version: "3"
21
services:
32
hm-brilleavtale-frontend:
43
build: .
54
image: "hm-brilleavtale-frontend"
65
ports:
7-
- "5000:5000"
6+
- "9000:5000"
7+
environment:
8+
NAIS_CLUSTER_NAME: 'dev-gcp'
9+
BIND_ADDRESS: ':5000'
10+
BRILLE_API_BASE_URL: 'http://localhost:4040'
11+
USE_MSW: 'true'

0 commit comments

Comments
 (0)