From b634a7f5254f5f85bd4589699961140ba2dc4fc9 Mon Sep 17 00:00:00 2001 From: spiess-demos <40452344+spiess-demos@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:48:46 +0200 Subject: [PATCH] feat: add a docker setup for local development (#984) To overcome the uncertainty of different node versions for local development, a docker container can now be used. --- README.md | 17 +++++++++++++++++ docker-compose.local.yml | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 docker-compose.local.yml diff --git a/README.md b/README.md index b3171e79f..658255992 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,20 @@ [![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org) Vue components, Vue directives, Design Token and Scss files to build interfaces for demosPlan. + +### Using the local Docker container + +To have a consistent environment for building demosplan-ui, a Docker configuration exists. +For Docker Compose 1, the syntax has to be adapted to `docker-compose` instead of `docker compose`. +The below commands use Docker Compose 2 syntax. + +```shell +# Start the container +docker compose -f docker-compose.local.yml up -d + +# Shell into the container +docker compose -f docker-compose.local.yml exec demosplan_ui_local sh + +# Stop container +docker compose -f docker-compose.local.yml down +``` diff --git a/docker-compose.local.yml b/docker-compose.local.yml new file mode 100644 index 000000000..e59d6f9c5 --- /dev/null +++ b/docker-compose.local.yml @@ -0,0 +1,9 @@ +services: + demosplan_ui_local: + image: node:18-alpine # Set to node:20-alpine for node 20 + environment: + - TZ=Europe/Berlin # Jest tests related to date fail with a UTC container + working_dir: /app + volumes: + - .:/app + command: sh -c "tail -f /dev/null"