diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc7a54a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM node:23.9.0-bullseye +LABEL authors="iptoux" + +# Setze das Arbeitsverzeichnis im Container +WORKDIR /app + +# Installiere Git und bereinige den apt-Cache in einem einzigen Layer +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Installiere Angular CLI global +RUN npm install -g @angular/cli + +# Klone das Repository +RUN git clone https://github.com/iptoux/AngularTasks + +# Setze das Arbeitsverzeichnis auf das Angular-Projekt +WORKDIR /app/AngularTasks + +RUN npm install + +COPY entrypoint.sh . + +# Mache das Start-Skript ausführbar +RUN chmod +x entrypoint.sh + +# Exponiere die Ports +EXPOSE 4200 + +# Setze den Standardbefehl +CMD ["./entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7abe48e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.8' + +services: + angular_tasks: + build: . + hostname: angular-tasks + ports: + - "4200:4200" + volumes: + - angular_node_modules:/app/AngularTasks/node_modules + environment: + - NODE_ENV=production + restart: unless-stopped + +volumes: + angular_node_modules: diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..d5cdab5 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /app/AngularTasks +#ng serve --host 0.0.0.0 --disable-host-check --poll 2000 +npx ng serve --host 0.0.0.0 --poll 2000 & diff --git a/package-lock.json b/package-lock.json index da7a8ae..3e58a98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "untitled1", - "version": "0.0.0", + "name": "mytaskapplication", + "version": "1.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "untitled1", - "version": "0.0.0", + "name": "mytaskapplication", + "version": "1.3.3", "dependencies": { "@angular/cdk": "^19.2.4", "@angular/common": "^19.2.0", diff --git a/package.json b/package.json index d40ae94..bc7a3dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mytaskapplication", - "version": "1.3.3", + "version": "1.3.5", "main": "app.js", "scripts": { "ng": "ng",