-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
27 lines (20 loc) · 991 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Use an official Node.js runtime as the base image
FROM node:16.16.0
# Set the working directory in the container to /app
WORKDIR /app
# Copy the application's source code to the working directory
COPY . .
# Install the application's dependencies inside the Docker image
RUN npm install
# Add the PostgreSQL repository
RUN apt-get update && \
apt-get install -y curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates && \
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Install PostgreSQL client tools
RUN apt-get update && \
apt-get install -y postgresql-13 postgresql-client-13
# Make port 80 available outside of the container for the application to use
EXPOSE 80
# Define the Docker image's behavior at runtime
CMD [ "npm", "start"]