updated docker
This commit is contained in:
69
Dockerfile
69
Dockerfile
@@ -1,46 +1,41 @@
|
|||||||
# Use the official PHP image based on Alpine Linux
|
# Use an official PHP 5.6 Apache image
|
||||||
FROM php:5.6-fpm-alpine
|
FROM php:5.6-apache
|
||||||
|
|
||||||
# Install system dependencies and PHP extensions
|
# Set the working directory inside the container
|
||||||
RUN apk --update --no-cache add \
|
WORKDIR /var/www/html
|
||||||
nginx \
|
|
||||||
libpng-dev \
|
|
||||||
libjpeg-turbo-dev \
|
|
||||||
freetype-dev \
|
|
||||||
libzip-dev \
|
|
||||||
zip \
|
|
||||||
unzip \
|
|
||||||
libmcrypt-dev \
|
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
||||||
&& docker-php-ext-install gd pdo pdo_mysql zip mcrypt
|
|
||||||
|
|
||||||
# Set the working directory in the container
|
# Install required dependencies
|
||||||
WORKDIR /var/www
|
RUN apt-get update && \
|
||||||
|
apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng12-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libzip-dev \
|
||||||
|
unzip \
|
||||||
|
git \
|
||||||
|
curl
|
||||||
|
|
||||||
# Clear cache
|
# Install Composer globally
|
||||||
# RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Copy the Laravel application files to the container
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Set appropriate permissions for Laravel storage and bootstrap cache
|
|
||||||
RUN chown -R www-data:www-data storage bootstrap
|
|
||||||
|
|
||||||
# Install Composer
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
# Enable required PHP extensions
|
||||||
|
RUN docker-php-ext-install pdo_mysql mbstring zip mcrypt
|
||||||
|
|
||||||
|
# Enable Apache modules
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
|
# Copy the Laravel application files into the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
# Install Laravel dependencies
|
# Install Laravel dependencies
|
||||||
RUN composer install --no-plugins --no-scripts
|
RUN composer install --no-interaction --optimize-autoloader
|
||||||
|
|
||||||
# Generate Laravel application key
|
# Set permissions
|
||||||
RUN php artisan key:generate
|
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap
|
||||||
|
|
||||||
# Create directory for the socket and set permissions
|
# Expose port 80
|
||||||
RUN mkdir -p /run/php && chown www-data:www-data /run/php
|
EXPOSE 80
|
||||||
|
|
||||||
# Copy the www.conf file to PHP-FPM pool.d directory
|
# Start the Apache server
|
||||||
# COPY www.conf /usr/local/etc/php-fpm.d/www.conf
|
CMD ["apache2-foreground"]
|
||||||
|
|
||||||
# Expose port 9000 and start php-fpm server
|
|
||||||
EXPOSE 9000
|
|
||||||
CMD ["php-fpm"]
|
|
||||||
|
|||||||
@@ -67,18 +67,24 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-8 mt-5">
|
<div class="col-lg-8 mt-5">
|
||||||
<form action="">
|
|
||||||
|
<div id="login-response-msg"></div>
|
||||||
|
<form role="form" id="frm-login">
|
||||||
|
<input type="hidden" name="redirect" value="{{ Request::get('redirectUrl') }}">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control form-control-lg contact-input-custom"
|
class="form-control form-control-lg contact-input-custom"
|
||||||
placeholder="Username*"
|
placeholder="Username*"
|
||||||
|
name="email" value="{{ old('email') }}"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
|
name="password"
|
||||||
class="form-control form-control-lg contact-input-custom"
|
class="form-control form-control-lg contact-input-custom"
|
||||||
required
|
required
|
||||||
placeholder="Password*"
|
placeholder="Password*"
|
||||||
|
|||||||
@@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
<p class="text-start">
|
<p class="text-start">
|
||||||
Already have an account?
|
Already have an account?
|
||||||
<router-link to="/login">Login</router-link>
|
<a href="{{ url('./auth/login') }}">Login</a>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -84,24 +84,64 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="navbar-nav ms-auto">
|
<ul class="navbar-nav ms-auto">
|
||||||
|
@if (Auth::guest())
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{{ url('./auth/register') }}">
|
||||||
|
<i class="icon icon-sign-up"></i> Sign Up
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{{ url('./auth/login') }}">
|
||||||
|
<i class="icon icon-sign-in"></i>
|
||||||
|
Log In
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
@else
|
||||||
|
|
||||||
|
|
||||||
|
@if(Auth::user()->role == "admin")
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url('./auth/register') }}">
|
<a class="nav-link" href="{{ url('./auth/admin') }}">
|
||||||
<i class="icon icon-sign-up"></i> Sign Up
|
{{-- <i class="icon icon-sign-in"></i> --}}
|
||||||
|
Dashboard
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@elseif(Auth::user()->role == "store_owner")
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<!-- <router-link to="/login" class="nav-link">
|
{{-- <a href="{{ url('user') }}" class="nav-link btn btn-white-outline btn-sm text-uppercase mx-1">Dashboard</a> --}}
|
||||||
<i class="icon icon-sign-in"></i>
|
<a class="nav-link" href="{{ url('./auth/user') }}">
|
||||||
Log In
|
{{-- <i class="icon icon-sign-in"></i> --}}
|
||||||
</router-link> -->
|
Dashboard
|
||||||
<a class="nav-link" href="{{ url('./auth/login') }}">
|
|
||||||
<i class="icon icon-sign-in"></i>
|
|
||||||
Log In
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@else
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#!">
|
<a class="nav-link" href="{{ url('./auth/user') }}">
|
||||||
|
{{-- <i class="icon icon-sign-in"></i> --}}
|
||||||
|
Dashboard
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
{{-- <a href="{{ url('./auth/logout') }}" class="nav-link btn btn-white-outline btn-sm text-uppercase mx-1">Logout</a> --}}
|
||||||
|
<a class="nav-link" href="{{ url('./auth/logout') }}">
|
||||||
|
<i class="icon icon-sign-in"></i>
|
||||||
|
Logout
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
{{-- <a href="{{ url('cart') }}" type="button" class="nav-link btn btn-navbar-cart btn-sm">
|
||||||
|
<i class="icon icon-cart"></i>
|
||||||
|
<span class="badge bg-secondary">{{ \App\Http\Controllers\MainController::getCountCart() }}</span>
|
||||||
|
</a> --}}
|
||||||
|
<a class="nav-link" href="{{ url('cart') }}" type="button">
|
||||||
<i class="icon icon-cart"></i>
|
<i class="icon icon-cart"></i>
|
||||||
|
<span class="badge bg-secondary">{{ \App\Http\Controllers\MainController::getCountCart() }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user