added files

This commit is contained in:
Hion-V 2022-11-15 11:51:25 +01:00
parent 5851ed822d
commit 7ad81f767e
2 changed files with 87 additions and 0 deletions

46
docker-compose.yml Normal file
View File

@ -0,0 +1,46 @@
version: "3"
services:
db:
image: mariadb
restart: always
ports:
- 8889:3306
volumes:
- ./db/data/mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: 'kanker'
MYSQL_USER: 'kanker'
MYSQL_PASSWORD: 'kanker'
MYSQL_ROOT_PASSWORD: kanker
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- 8081:80
environment:
# - PMA_ARBITRARY=1
- DB_HOST=db
php:
build:
args:
user: andreas
uid: 1000
context: "./php/"
dockerfile: Dockerfile
restart: always
environment:
- DB_HOST=db
- DB_USERNAME=root
ports:
- 9001:9000
- 8000:8000
expose:
- 8000
- 9000
- 80
- 443
# volumes:
# - ./WebsiteAPI:/var/www/html

41
php/Dockerfile Normal file
View File

@ -0,0 +1,41 @@
FROM php:8.1-fpm AS phpbase
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Set working directory
WORKDIR /var/www/html
USER $user
COPY ./WebsiteAPI /var/www/html/
RUN composer install
RUN composer update
CMD ["php","artisan","serve","--port=9000","--host=0.0.0.0"]