From e765bc76aee7187f04a617067496c2509b2b1825 Mon Sep 17 00:00:00 2001 From: Ilamparidhi Date: Thu, 13 Feb 2025 18:16:52 +0530 Subject: [PATCH 1/3] Create Dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..c8079ea4c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Use an official Node.js runtime as a parent image +FROM node:18 + +# Set working directory +WORKDIR /app + +# Copy package.json and install dependencies +COPY package*.json ./ +RUN npm install + +# Copy the rest of the application +COPY . . + +# Expose port 85 (as per your requirement) +EXPOSE 85 + +# Start the application +CMD ["npm", "start"] From f8785e96f1bd85e887f134d5d93075fdae144819 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 13 Feb 2025 12:56:01 +0000 Subject: [PATCH 2/3] first --- Dockerfile | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8079ea4c..111053190 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,11 @@ -# Use an official Node.js runtime as a parent image -FROM node:18 +# Use official Apache image +FROM httpd:latest -# Set working directory -WORKDIR /app +# Copy website files to Apache document root +COPY ./public-html/ /usr/local/apache2/htdocs/ -# Copy package.json and install dependencies -COPY package*.json ./ -RUN npm install +# Expose port 80 +EXPOSE 80 -# Copy the rest of the application -COPY . . - -# Expose port 85 (as per your requirement) -EXPOSE 85 - -# Start the application -CMD ["npm", "start"] +# Start Apache +CMD ["httpd", "-D", "FOREGROUND"] From 9c3d8a574623da118b60440d8ba56322fb9eb13f Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 13 Feb 2025 12:58:33 +0000 Subject: [PATCH 3/3] first --- Dockerfile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 111053190..85210f567 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,21 @@ -# Use official Apache image -FROM httpd:latest +# Use PHP with Apache +FROM php:8.2-apache -# Copy website files to Apache document root -COPY ./public-html/ /usr/local/apache2/htdocs/ +# Set working directory +WORKDIR /var/www/html + +# Copy project files to the container +COPY . /var/www/html + +# Give proper permissions +RUN chown -R www-data:www-data /var/www/html \ + && chmod -R 755 /var/www/html + +# Enable mod_rewrite for Apache (optional) +RUN a2enmod rewrite # Expose port 80 EXPOSE 80 -# Start Apache -CMD ["httpd", "-D", "FOREGROUND"] +# Start Apache in foreground +CMD ["apache2-foreground"]