SwapStation_WebApp/frontend/Dockerfile

23 lines
696 B
Docker

# Use an official Nginx runtime as a parent image
FROM nginx:alpine
# Set the working directory to the Nginx web root
WORKDIR /usr/share/nginx/html
# Remove the default Nginx welcome page
RUN rm -f /usr/share/nginx/html/index.html
# Copy the static assets from the frontend directory into the container
# This includes your HTML, CSS, JS, and assets folders.
COPY . .
# Copy the custom Nginx configuration
# This replaces the default config with our version that includes the API proxy.
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 to allow traffic to the Nginx server
EXPOSE 80
# The command to start Nginx when the container launches
CMD ["nginx", "-g", "daemon off;"]