Explorar el Código

build: Add Docker files

Sean Blackburn hace 10 meses
padre
commit
bcf9be1027
Se han modificado 3 ficheros con 27 adiciones y 0 borrados
  1. 1 0
      .dockerignore
  2. 17 0
      Dockerfile
  3. 9 0
      compose.yaml

+ 1 - 0
.dockerignore

@@ -0,0 +1 @@
+public/data

+ 17 - 0
Dockerfile

@@ -0,0 +1,17 @@
+FROM node:23.11 AS builder
+
+WORKDIR /app
+
+COPY package*.json .
+
+RUN npm install --only=prod
+
+COPY . .
+
+RUN npm run build
+
+
+########################################################################################
+FROM nginx:1.28-alpine-slim
+
+COPY --from=builder /app/dist /usr/share/nginx/html

+ 9 - 0
compose.yaml

@@ -0,0 +1,9 @@
+services:
+  frontend:
+    build:
+      context: .
+      dockerfile: Dockerfile
+    volumes:
+      - ./public/data:/usr/share/nginx/html/data
+    ports:
+      - 8080:80