25 lines
479 B
Docker
25 lines
479 B
Docker
# 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
|
|
|
|
# Set the working directory
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy the package.json and package-lock.json files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Expose the port the app runs on
|
|
EXPOSE 3000
|
|
|
|
# Command to run the application
|
|
CMD ["node", "server.js"]
|
|
|