Skip to content

Feat/dockerize project #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Base image with PHP and required extensions
FROM php:8.1-fpm

# Set working directory
WORKDIR /var/www

# Install dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
zip \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql zip gd

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Copy existing application code to the container
COPY . .

# Set permissions for Laravel
RUN chown -R www-data:www-data /var/www \
&& chmod -R 755 /var/www/storage /var/www/bootstrap/cache

# Expose port 9000 and start PHP-FPM
EXPOSE 9000
CMD ["php-fpm"]
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"version": "v8.2.1",
"require": {
"php": "^7.3.0",
"alexusmai/laravel-file-manager": "^2.5",
"alexusmai/laravel-file-manager": "^3.2.0",
"arcanedev/log-viewer": "^8.0",
"cviebrock/eloquent-sluggable": "^8.0",
"doctrine/dbal": "~2.3",
Expand All @@ -22,7 +22,7 @@
"infyomlabs/laravel-generator": "8.0.x-dev",
"kreait/laravel-firebase": "^3.0",
"laracasts/flash": "^3.2",
"laravel/framework": "^8.0",
"laravel/framework": "^11.0",
"laravel/slack-notification-channel": "^2.2",
"laravel/socialite": "^5.0",
"laravel/tinker": "^2.4",
Expand Down
Binary file added composer.phar
Binary file not shown.
Binary file added composer_update.log
Binary file not shown.
49 changes: 49 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3.8'

services:
app:
build:
context: .
dockerfile: Dockerfile
image: laravel_startkit
container_name: laravel_startkit
working_dir: /var/www
volumes:
- .:/var/www
networks:
- laravel_network

webserver:
image: nginx:latest
container_name: laravel_webserver
depends_on:
- app
volumes:
- .:/var/www
- ./docker/nginx:/etc/nginx/conf.d
ports:
- "8080:80"
networks:
- laravel_network

db:
image: mysql:8.0
container_name: laravel_db
restart: always
environment:
MYSQL_DATABASE: laravel
MYSQL_USER: laravel
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"
volumes:
- dbdata:/var/lib/mysql
networks:
- laravel_network

volumes:
dbdata:

networks:
laravel_network:
20 changes: 20 additions & 0 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
listen 80;
index index.php index.html;
root /var/www/public;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~ /\.ht {
deny all;
}
}
10 changes: 10 additions & 0 deletions upgrade.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- mcamara/laravel-localization[1.6.0, ..., 1.6.2] require laravel/framework ~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0||^8.0 -> found laravel/framework[v5.2.0-beta1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but it conflicts with your root composer.json require (^11.0).
- mcamara/laravel-localization v1.7.0 requires laravel/framework ~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0||^8.0||^9.0 -> found laravel/framework[v5.2.0-beta1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev] but it conflicts with your root composer.json require (^11.0).
- mcamara/laravel-localization[V1.8.0, ..., 1.x-dev] require laravel/framework ~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0||^8.0||^9.0|^10.0 -> found laravel/framework[v5.2.0-beta1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev] but it conflicts with your root composer.json require (^11.0).
- Root composer.json requires mcamara/laravel-localization ^1.6 -> satisfiable by mcamara/laravel-localization[1.6.0, ..., 1.x-dev].