Commit 8c3a06dc by shameelaz

commit docker

parent 2d10546b
FROM php:7.4-apache
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libldap2-dev \
zip \
unzip \
git \
curl \
nodejs \
npm
# Configure and install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip ldap
# Enable Apache mod_rewrite
RUN a2enmod rewrite
# Update Apache DocumentRoot to Laravel's public directory
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Install Composer
COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer
# Copy existing application directory
COPY . /var/www/html
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
# Set up the entrypoint script
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 80
ENTRYPOINT ["entrypoint.sh"]
\ No newline at end of file
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
image: 3f-timesheet-app
container_name: 3f-timesheet-app
restart: unless-stopped
ports:
- "8000:80"
depends_on:
- db
networks:
- timesheet-network
db:
image: mysql:5.7
container_name: 3f-timesheet-db
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
ports:
- "3306:3306"
volumes:
- dbdata:/var/lib/mysql
networks:
- timesheet-network
networks:
timesheet-network:
driver: bridge
volumes:
dbdata:
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment