From 5d77266d05c5f91817359b6febb39f309e155987 Mon Sep 17 00:00:00 2001 From: herve0742 Date: Mon, 23 Jan 2023 13:01:24 +0100 Subject: [PATCH] docker: set up a configuration for development --- .editorconfig | 3 +++ compose.yaml | 13 +++++++++++++ docker/dev/entrypoint.sh | 2 ++ package.json | 4 ++++ src/environments/endpoints.ts | 8 ++++---- 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 compose.yaml create mode 100755 docker/dev/entrypoint.sh diff --git a/.editorconfig b/.editorconfig index 43891190..51f6027b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,6 @@ trim_trailing_whitespace = true [*.md] max_line_length = off trim_trailing_whitespace = false + +[*.yaml] +indent_style = space diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 00000000..95f18b82 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,13 @@ +services: + date-front: + image: node:lts-slim + entrypoint: + - "bash" + - "docker/dev/entrypoint.sh" + volumes: + - '.:/var/www/html/funky-framadate-front' + working_dir: '/var/www/html/funky-framadate-front' + environment: + - "NODE_OPTIONS=--openssl-legacy-provider" + ports: + - "4200:4200" diff --git a/docker/dev/entrypoint.sh b/docker/dev/entrypoint.sh new file mode 100755 index 00000000..56136c36 --- /dev/null +++ b/docker/dev/entrypoint.sh @@ -0,0 +1,2 @@ +yarn install --pure-lockfile +yarn start_docker diff --git a/package.json b/package.json index 35fc0c19..f074ada7 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "scripts": { "ng": "ng", "start": "ng serve", + "start_docker": "ng serve --host 0.0.0.0", "build:prod": "ng build --prod", "build:prod:stats": "ng build --prod --stats-json", "build:prod:gitlabpage": "ng build --prod --baseHref=/framadate/funky-framadate-front/", @@ -130,5 +131,8 @@ "^.+\\.(ts|html)$": "ts-jest", "^.+\\.jsx?$": "babel-jest" } + }, + "browser": { + "crypto": false } } diff --git a/src/environments/endpoints.ts b/src/environments/endpoints.ts index 99bd15c5..425edf0f 100644 --- a/src/environments/endpoints.ts +++ b/src/environments/endpoints.ts @@ -4,13 +4,13 @@ export const backendApiUrlsInDev = { local: 'http://localhost:8000/api/v1', // the docker port is this one // local: 'http://www.tk.lan/index.php/api/v1', // local: 'https://framadate-api.cipherbliss.com/api/v1', - // remote: 'http://localhost:8000/api/v1', + remote: 'http://localhost:8000/api/v1', // remote: 'http://www.tk.lan/index.php/api/v1', - remote: 'https://framadate-api.cipherbliss.com/api/v1', + //remote: 'https://framadate-api.cipherbliss.com/api/v1', }; export const apiV1 = { - // baseHref: 'http://localhost:8000/api/v1', // local "symfony serve" live server - baseHref: 'http://www.tk.lan/index.php/api/v1', // local apache2 server + baseHref: 'http://localhost:8000/api/v1', // local "symfony serve" live server + // baseHref: 'http://www.tk.lan/index.php/api/v1', // local apache2 server // baseHref: 'http://tktest.lan/api/v1', // baseHref: 'https://framadate-api.cipherbliss.com/api/v1', // demo preprod api_new_poll: '/poll/',