Commit 9bb43bd7 authored by dhevanthareza's avatar dhevanthareza

docker base php

parents
FROM php:8.1-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN apt-get update -y && apt-get install -y libpng-dev
RUN apt-get update && \
apt-get install -y \
zlib1g-dev
RUN docker-php-ext-install gd
RUN a2enmod rewrite
RUN service apache2 restart
# CHEATSHET
1. This is Dockerfile that u can used to run php based project
2. to change php version you change it on Dockerfile
3. Maybe you need to change the port forwarding on docker-compose.yml so wont crash with your another service on your laptop
4. then for run your project just do docker-compose up --build at first time and docker-compose up on next time
\ No newline at end of file
version: '3.1'
services:
php-apache:
container_name: digitepp
build:
context: .
dockerfile: Dockerfile
ports:
- 4000:80
volumes:
- ./:/var/www/html/
- ./apache/default.conf:/etc/apache2/sites-enabled/000-default.conf
service-mysql:
container_name: mysqlnyadigitepp
build:
context: .
dockerfile: DockerfileMysql
\ 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