- Integrated express-basic-auth middleware in index.js to secure non-GET routes with basic authentication. - Updated libraryManager.py to use HTTPBasicAuth for API requests, enhancing security for book management operations. - Modified public/index.html to improve the user interface with a new search feature and dynamic book table. - Removed obsolete public/library.html file to streamline the project structure. - Updated package.json and package-lock.json to include express-basic-auth as a new dependency.
24 lines
520 B
Docker
24 lines
520 B
Docker
# Use an official Node.js runtime as a parent image
|
|
FROM node:14
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy package.json and package-lock.json to the working directory
|
|
COPY package*.json ./
|
|
|
|
# Install any needed packages specified in package.json
|
|
RUN npm install
|
|
|
|
# Copy the rest of the application code to the working directory
|
|
COPY . .
|
|
|
|
# Expose the port the app runs on
|
|
EXPOSE 3000
|
|
|
|
# Define environment variable
|
|
ENV NODE_ENV=production
|
|
|
|
# Run the application
|
|
CMD ["node", "index.js"]
|