Version Final!
This commit is contained in:
parent
21538b36c6
commit
dc87ec9538
1
z2/.env
1
z2/.env
@ -3,4 +3,3 @@ DB_PORT=5432
|
||||
DB_USER=postgres
|
||||
DB_PASSWORD=motdepasse
|
||||
DB_NAME=tododb
|
||||
|
||||
|
@ -1,24 +1,21 @@
|
||||
# Use the official Node.js 16 image as the base image
|
||||
FROM node:16
|
||||
|
||||
# Install PostgreSQL client
|
||||
RUN apt-get update && apt-get install -y postgresql-client
|
||||
# Use a base Node.js image
|
||||
FROM node:18
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy the package.json and package-lock.json files
|
||||
# Copy package.json and package-lock.json files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code
|
||||
# Copy the rest of the application files
|
||||
COPY . .
|
||||
|
||||
# Expose the port the app runs on
|
||||
EXPOSE 3000
|
||||
|
||||
# Command to run the application
|
||||
# Command to start the application
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
|
@ -20,7 +20,7 @@ spec:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: DB_HOST
|
||||
value: postgres-service
|
||||
value: postgres-service.my-namespace.svc.cluster.local
|
||||
- name: DB_PORT
|
||||
value: "5432"
|
||||
- name: DB_USER
|
||||
|
@ -11,4 +11,4 @@ spec:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 3000
|
||||
nodePort: 30080 # Tu peux changer ce port si nécessaire (entre 30000–32767)
|
||||
nodePort: 30080
|
||||
|
Loading…
Reference in New Issue
Block a user