diff --git a/API/docker/production/Dockerfile b/API/docker/production/Dockerfile index 34354b5..0124eaf 100644 --- a/API/docker/production/Dockerfile +++ b/API/docker/production/Dockerfile @@ -20,7 +20,10 @@ RUN apt-get update && apt-get install -y \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Install PHP extensions -RUN docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd intl zip soap +RUN docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd intl zip soap opcache + +# Copy custom opcache configuration +COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini # Enable Apache Rewrite module (required by Laravel) RUN a2enmod rewrite @@ -28,6 +31,15 @@ RUN a2enmod rewrite # Copy existing application directory contents COPY . /var/www/html +# Set Apache to serve the Laravel "public" directory +RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|' /etc/apache2/sites-available/000-default.conf + +# Also allow .htaccess overrides in public directory +RUN echo '\n\ + AllowOverride All\n\ + Require all granted\n\ +' >> /etc/apache2/apache2.conf + # Copy existing application directory permissions RUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html diff --git a/API/opcache.ini b/API/opcache.ini new file mode 100644 index 0000000..b193c20 --- /dev/null +++ b/API/opcache.ini @@ -0,0 +1,9 @@ +; Enable OPcache +zend_extension=opcache +opcache.enable=1 +opcache.enable_cli=1 +opcache.memory_consumption=128 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000 +opcache.revalidate_freq=2 +opcache.validate_timestamps=1 diff --git a/Frontend/shared/.env b/Frontend/shared/.env index 83bf5b5..5494f0f 100644 --- a/Frontend/shared/.env +++ b/Frontend/shared/.env @@ -1,3 +1,2 @@ API_DOMAIN=api.speedcartapp.com -API_PORT=80 TESTING_MODE=false \ No newline at end of file diff --git a/Frontend/shared/src/constants/BaseUrl.ts b/Frontend/shared/src/constants/BaseUrl.ts index 0d2bf7d..d73b5d6 100644 --- a/Frontend/shared/src/constants/BaseUrl.ts +++ b/Frontend/shared/src/constants/BaseUrl.ts @@ -2,11 +2,10 @@ import config from './config.json'; const API_DOMAIN = config.API_DOMAIN; -const API_PORT = config.API_PORT; // Protocol depends on if we're using dev or production const API_PROTOCOL = API_DOMAIN === 'localhost' ? 'http' : 'https'; // This can be reused for all backend interactions -export const BASE_URL: string = `${API_PROTOCOL}://${API_DOMAIN}:${API_PORT}`; +export const BASE_URL: string = `${API_PROTOCOL}://${API_DOMAIN}`; export const TESTING_MODE: boolean = config.TESTING_MODE === 'true'; \ No newline at end of file