From 7c6ce4c71ba147a5dec1c899564a1387f92127a8 Mon Sep 17 00:00:00 2001
From: Victor <victor.calleja.garcia@estudiantes.uva.es>
Date: Sun, 8 Dec 2024 19:12:10 +0100
Subject: [PATCH] a

---
 angularVinos/.dockerignore                    | 25 +++++++++++++++++++
 angularVinos/Dockerfile                       | 10 ++++++++
 angularVinos/nginx-custom.conf                |  8 ++++++
 ...pose.debug.yml => docker-compose.debug.yml |  0
 .../docker-compose.yml => docker-compose.yml  | 14 ++++++++++-
 5 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 angularVinos/.dockerignore
 create mode 100644 angularVinos/Dockerfile
 create mode 100644 angularVinos/nginx-custom.conf
 rename springVinos/docker-compose.debug.yml => docker-compose.debug.yml (100%)
 rename springVinos/docker-compose.yml => docker-compose.yml (78%)

diff --git a/angularVinos/.dockerignore b/angularVinos/.dockerignore
new file mode 100644
index 0000000..3dbbcf3
--- /dev/null
+++ b/angularVinos/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/bin
+**/charts
+**/docker-compose*
+**/compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
diff --git a/angularVinos/Dockerfile b/angularVinos/Dockerfile
new file mode 100644
index 0000000..f3d23cd
--- /dev/null
+++ b/angularVinos/Dockerfile
@@ -0,0 +1,10 @@
+FROM node:23 AS build
+RUN mkdir -p /app
+WORKDIR /app
+COPY package*.json ./
+RUN npm install
+COPY . /app
+RUN npm run build --prod
+FROM nginx:alpine
+COPY --from=build /app/dist/ej-rest-client/browser/ /usr/share/nginx/html
+COPY --from=build /app/nginx-custom.conf /etc/nginx/conf.d/default.conf
diff --git a/angularVinos/nginx-custom.conf b/angularVinos/nginx-custom.conf
new file mode 100644
index 0000000..0595e87
--- /dev/null
+++ b/angularVinos/nginx-custom.conf
@@ -0,0 +1,8 @@
+server {
+listen 80;
+location / {
+root /usr/share/nginx/html;
+index index.html index.htm;
+try_files $uri $uri/ /index.html =404;
+}
+}
diff --git a/springVinos/docker-compose.debug.yml b/docker-compose.debug.yml
similarity index 100%
rename from springVinos/docker-compose.debug.yml
rename to docker-compose.debug.yml
diff --git a/springVinos/docker-compose.yml b/docker-compose.yml
similarity index 78%
rename from springVinos/docker-compose.yml
rename to docker-compose.yml
index bd82a26..44544be 100644
--- a/springVinos/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,10 +8,22 @@ networks: # Red interna para comunicar los servicios
   kong-net: {}
 
 services:
+  front:
+    image: my-angular-app
+    build:
+      context: ./angularVinos
+      dockerfile: ./Dockerfile
+    restart: unless-stopped
+    ports:
+      - "4200:80"
+    networks:
+      - kong-net
+
+
   Vinos-API:
     image: tiendavinos-api-image
     build:
-      context: .
+      context: ./springVinos
       dockerfile: ./Dockerfile
     restart: unless-stopped
     ports:
-- 
GitLab