-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_Frontend
36 lines (27 loc) · 997 Bytes
/
Dockerfile_Frontend
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
28
29
30
31
32
33
34
35
36
# Use an official Node.js runtime as the base image
FROM node:20
LABEL authors="iejohnson"
ENV NEXT_PUBLIC_BACKEND_URL="http://backend.example.com"
# Set the working directory in the Docker image
WORKDIR /app
RUN apt-get update && apt-get install -y \
inetutils-ping \
# Clean up the apt cache to reduce image size
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy package.json and to the working directory
COPY /job_monitoring_app/frontend/package.json ./
COPY /job_monitoring_app/frontend/package-lock.json ./
COPY /job_monitoring_app/frontend/public ./public
COPY /job_monitoring_app/frontend/src ./src
COPY /job_monitoring_app/frontend/fixtures ./fixtures
COPY /job_monitoring_app/frontend/next.config.js ./
COPY /job_monitoring_app/frontend/tsconfig.json ./
# Install the application dependencies
RUN npm install
# Build the application
RUN npm run build
# Expose port 3000 for the application
EXPOSE 3000
# Start the application
CMD [ "npm", "run", "start" ]