Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion API/docker/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@ 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

# 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 '<Directory /var/www/html/public>\n\
AllowOverride All\n\
Require all granted\n\
</Directory>' >> /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
Expand Down
9 changes: 9 additions & 0 deletions API/opcache.ini
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion Frontend/shared/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
API_DOMAIN=api.speedcartapp.com
API_PORT=80
TESTING_MODE=false
3 changes: 1 addition & 2 deletions Frontend/shared/src/constants/BaseUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';