diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4ed214f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Use official Node.js LTS image +FROM node:18-alpine + +# Set working directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy application files +COPY public/images ./public/images +COPY . . + +# Expose the application port +EXPOSE 3000 + +# Set environment variables +ENV NODE_ENV=production + +# Health check endpoint +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s \ + CMD curl -f http://localhost:3000/ || exit 1 + +# Run the application +CMD ["node", "server.js"] + diff --git a/myrari/deployment.yaml b/myrari/deployment.yaml new file mode 100644 index 0000000..da79451 --- /dev/null +++ b/myrari/deployment.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: myfari-app + namespace: farui + labels: + app: myfari +spec: + replicas: 3 + selector: + matchLabels: + app: myfari + template: + metadata: + labels: + app: myfari + spec: + containers: + - name: myfari + image: localhost:32000/public/myfari:v03 + ports: + - containerPort: 3000 + env: + - name: NODE_ENV + value: "production" + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + livenessProbe: + httpGet: + path: / + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /ready + port: 3000 + initialDelaySeconds: 5 + periodSeconds: 5 + diff --git a/myrari/service.yaml b/myrari/service.yaml new file mode 100644 index 0000000..75c6c43 --- /dev/null +++ b/myrari/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: myfari-service + namespace: farui + labels: + app: myfari +spec: + selector: + app: myfari + ports: + - protocol: TCP + port: 80 + targetPort: 3000 + type: ClusterIP + diff --git a/public/images/law.jpg b/public/images/law.jpg new file mode 100644 index 0000000..1aeddd7 Binary files /dev/null and b/public/images/law.jpg differ diff --git a/public/index.html b/public/index.html index edc94ca..4b7eebd 100644 --- a/public/index.html +++ b/public/index.html @@ -3,8 +3,21 @@
-