generated from SAP/repository-template
-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: separate out dashboard docker image
closes #1040 Signed-off-by: Jérôme Benoit <[email protected]>
- Loading branch information
1 parent
216a56a
commit 20fb109
Showing
14 changed files
with
155 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
node dist/start.js & | ||
node ui/web/start.js | ||
node dist/start.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM node:lts-alpine AS builder | ||
|
||
# Build dashboard | ||
WORKDIR /usr/builder | ||
COPY . ./ | ||
RUN set -ex \ | ||
&& corepack enable \ | ||
&& corepack prepare pnpm@latest --activate \ | ||
&& pnpm set progress=false \ | ||
&& pnpm config set depth 0 \ | ||
&& pnpm install --ignore-scripts \ | ||
&& cp docker/config.json public/config.json \ | ||
&& pnpm build | ||
|
||
FROM node:lts-alpine | ||
|
||
WORKDIR /usr/app | ||
COPY --from=builder /usr/builder ./ | ||
COPY docker/start.sh /start.sh | ||
COPY docker/autoconfig.sh /autoconfig.sh | ||
RUN set -ex \ | ||
&& chmod +x /start.sh \ | ||
&& chmod +x /autoconfig.sh | ||
|
||
CMD /autoconfig.sh && /start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
PROJECT_NAME?=evse | ||
NAME:=e-mobility-charging-stations-dashboard | ||
SUBMODULES_INIT?=false | ||
DOCKER_ECR_ACCOUNT_ID?=166296450311 | ||
DOCKER_ECR_REGION?=eu-west-3 | ||
DOCKER_ECR_REGISTRY_NAME?=e-mobility-charging-stations-dashboard | ||
DOCKER_ECR_TAG?=latest | ||
|
||
.PHONY: all | ||
|
||
default: all | ||
|
||
submodule-update: | ||
git submodule update --init --recursive | ||
|
||
submodules-init= | ||
ifeq '$(SUBMODULES_INIT)' 'true' | ||
submodules-init += submodule-update | ||
endif | ||
|
||
$(NAME): $(submodules-init) | ||
docker compose -p $(PROJECT_NAME) up -d | ||
|
||
$(NAME)-force: $(submodules-init) | ||
docker compose -p $(PROJECT_NAME) up -d --build --force-recreate | ||
|
||
all: $(NAME) | ||
|
||
clean-images: | ||
-docker rmi $(PROJECT_NAME)-$(NAME) | ||
|
||
clean-containers: | ||
-docker compose -p $(PROJECT_NAME) down | ||
|
||
clean: clean-containers clean-images | ||
|
||
docker-tag-ecr: | ||
docker tag $(PROJECT_NAME)-$(NAME) $(DOCKER_ECR_ACCOUNT_ID).dkr.ecr.$(DOCKER_ECR_REGION).amazonaws.com/$(DOCKER_ECR_REGISTRY_NAME):$(DOCKER_ECR_TAG) | ||
|
||
docker-push-ecr: $(NAME)-force docker-tag-ecr | ||
aws ecr get-login-password --region $(DOCKER_ECR_REGION) | docker login --username AWS --password-stdin $(DOCKER_ECR_ACCOUNT_ID).dkr.ecr.$(DOCKER_ECR_REGION).amazonaws.com/$(DOCKER_ECR_REGISTRY_NAME) | ||
docker push $(DOCKER_ECR_ACCOUNT_ID).dkr.ecr.$(DOCKER_ECR_REGION).amazonaws.com/$(DOCKER_ECR_REGISTRY_NAME):$(DOCKER_ECR_TAG) | ||
|
||
dist-clean-images: | ||
docker image prune -a -f | ||
|
||
dist-clean-volumes: | ||
docker volume prune -f | ||
|
||
dist-clean: clean-containers dist-clean-volumes dist-clean-images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env sh | ||
|
||
if ! [ -z $emobility_server_type ] && ! [ -z $emobility_service_type ] | ||
then | ||
[ -z $emobility_install_dir ] && { echo "emobility installation directory env variable not found, exiting"; exit 1; } | ||
[ -z $emobility_landscape ] && { echo "emobility landscape env variable not found, exiting"; exit 1; } | ||
[ -z $emobility_server_type ] && { echo "emobility env server type variable not found, exiting"; exit 1; } | ||
[ -z $emobility_service_type ] && { echo "emobility env service type variable not found, exiting"; exit 1; } | ||
|
||
cp $emobility_install_dir/dist/assets/configs-docker/$emobility_server_type-$emobility_service_type-$emobility_landscape.json $emobility_install_dir/public/config.json | ||
else | ||
echo "no emobility env defined, start with default configuration" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"uiServer": { | ||
"host": "localhost", | ||
"port": 8080, | ||
"protocol": "ui", | ||
"version": "0.0.1", | ||
"authentication": { | ||
"enabled": true, | ||
"type": "protocol-basic-auth", | ||
"username": "admin", | ||
"password": "admin" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
networks: | ||
ev_network: | ||
driver: bridge | ||
services: | ||
e-mobility-charging-stations-dashboard: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile | ||
networks: | ||
- ev_network | ||
ports: | ||
- 3030:3030 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
node start.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters