Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oppsett for å debugge inni docker #1442

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/frackend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM gcr.io/distroless/nodejs20-debian12:nonroot
COPY . /app

WORKDIR /app
EXPOSE 8080
CMD ["--inspect=0.0.0.0:9229", "dist/index.js"]
31 changes: 23 additions & 8 deletions apps/frackend/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# Frontend for teams
# Frackend for teamkatalogen

### Requires node 16
### Hent secret

### Set up local env
run python script localenv_setup.py for å få korrekte azure varaiable etc fra k8s secrets
```bash
gcloud auth login

`python3 localenv_setup.py`
# Fra rot kjører du:
python setup_local_azure_secrets.py
```

### Install deps
### Installer pakker
`npm ci`

### Kjør Frackend
`npm run start`
### Bygg Frackend
`npm run build`

### Kjør docker-compose
`docker-compose up -d --build`
Denne fyrer opp lokal Wonderwall + Frackend

### Debug Frackend som kjører i Docker
Når Express-serveren kjører lokalt i Docker så eksponerer den port 9229 som du kan koble en debugger til.

For å få til dette må du lage en debug configuration:
1. Edit configurations
2. Klikk + og velg `attach to Node.js/Chrome`
3. Host: `localhost` port `9229`
4. Kjør så konfigurasjonen og du er klar til å debugge!
4 changes: 3 additions & 1 deletion apps/frackend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ services:
upstream:
build:
context: .
dockerfile: "Dockerfile"
dockerfile: "Dockerfile.dev"
ports:
- "8081:8081"
- "9229:9229"
environment:
DEBUG: "http-proxy-middleware*"
NODE_ENV: "development"
EXPRESS_PORT: 8081
EXPRESS_HOST: "::"
Expand Down
75 changes: 0 additions & 75 deletions apps/frackend/localenv_setup.py

This file was deleted.

4 changes: 0 additions & 4 deletions apps/frackend/template.localenv

This file was deleted.

Loading