Update Dockerfile_frontend

This commit is contained in:
João Vitória Silva
2023-11-29 17:56:08 +00:00
committed by GitHub
parent 9d8a94e8b5
commit 21df7493f1

View File

@@ -1,16 +1,26 @@
# Use an official Nginx image as a base image
FROM nginx:latest
# Use an official PHP runtime as a parent image
FROM php:8.3-apache
# Set the working directory to /app
WORKDIR /app
# Set the working directory to /var/www/html
WORKDIR /var/www/html
# Copy the PHP files into the container
COPY frontend/ /app
# Copy the current directory contents into the container at /var/www/html
COPY frontend/ /var/www/html
# Copy the Nginx configuration file
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Install any dependencies your application needs
RUN apt-get update
# Expose port 80 to the outside world
EXPOSE 80
# Define environment variable
# Define environment variables
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
# Enable Apache modules
RUN a2enmod rewrite
# Update the default virtual host to use the environment variable
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
# Start Apache
CMD ["apache2-foreground"]