Version Final!

This commit is contained in:
Emeline Nerot 2025-04-21 09:06:27 +00:00
parent 21538b36c6
commit dc87ec9538
4 changed files with 8 additions and 12 deletions

View File

@ -3,4 +3,3 @@ DB_PORT=5432
DB_USER=postgres DB_USER=postgres
DB_PASSWORD=motdepasse DB_PASSWORD=motdepasse
DB_NAME=tododb DB_NAME=tododb

View File

@ -1,24 +1,21 @@
# Use the official Node.js 16 image as the base image # Use a base Node.js image
FROM node:16 FROM node:18
# Install PostgreSQL client
RUN apt-get update && apt-get install -y postgresql-client
# Set the working directory # Set the working directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Copy the package.json and package-lock.json files # Copy package.json and package-lock.json files
COPY package*.json ./ COPY package*.json ./
# Install dependencies # Install dependencies
RUN npm install RUN npm install
# Copy the rest of the application code # Copy the rest of the application files
COPY . . COPY . .
# Expose the port the app runs on # Expose the port the app runs on
EXPOSE 3000 EXPOSE 3000
# Command to run the application # Command to start the application
CMD ["node", "server.js"] CMD ["node", "server.js"]

View File

@ -20,7 +20,7 @@ spec:
- containerPort: 3000 - containerPort: 3000
env: env:
- name: DB_HOST - name: DB_HOST
value: postgres-service value: postgres-service.my-namespace.svc.cluster.local
- name: DB_PORT - name: DB_PORT
value: "5432" value: "5432"
- name: DB_USER - name: DB_USER

View File

@ -11,4 +11,4 @@ spec:
- protocol: TCP - protocol: TCP
port: 80 port: 80
targetPort: 3000 targetPort: 3000
nodePort: 30080 # Tu peux changer ce port si nécessaire (entre 3000032767) nodePort: 30080