Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aphp1_classwork80
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Egor Kremnev
aphp1_classwork80
Commits
a070d48c
Commit
a070d48c
authored
Sep 05, 2023
by
Egor Kremnev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docker compose
parent
12a5f8db
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
0 deletions
+139
-0
Dockerfile
Dockerfile
+52
-0
docker-compose.yml
docker-compose.yml
+66
-0
app.conf
docker/nginx/app.conf
+20
-0
local.ini
docker/php/local.ini
+1
-0
No files found.
Dockerfile
0 → 100644
View file @
a070d48c
FROM
php:8.2-fpm
# Set working directory
WORKDIR
/var/www
# Install dependencies
RUN
apt-get update
&&
apt-get
install
-y
\
libzip-dev
\
libonig-dev
\
build-essential
\
libpng-dev
\
libjpeg62-turbo-dev
\
libfreetype6-dev
\
locales
\
zip
\
jpegoptim optipng pngquant gifsicle
\
vim
\
unzip
\
git
\
curl
# Clear cache
RUN
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
# Install extensions
RUN
docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN
apt-get update
&&
apt-get
install
-y
\
libfreetype6-dev
\
libjpeg62-turbo-dev
\
libpng-dev
\
&&
docker-php-ext-configure gd
--with-freetype
--with-jpeg
\
&&
docker-php-ext-install
-j
$(
nproc
)
gd
# Install composer
RUN
curl
-sS
https://getcomposer.org/installer | php
--
--install-dir
=
/usr/local/bin
--filename
=
composer
# Add user for laravel application
RUN
groupadd
-g
1000 www
RUN
useradd
-u
1000
-ms
/bin/bash
-g
www www
# Copy existing application directory contents
COPY
. /var/www
# Copy existing application directory permissions
COPY
--chown=www:www . /var/www
# Change current user to www
USER
www
# Expose port 9000 and start php-fpm server
EXPOSE
9000
CMD
["php-fpm"]
docker-compose.yml
0 → 100644
View file @
a070d48c
version
:
'
3'
services
:
#PHP Service
app
:
build
:
context
:
.
dockerfile
:
Dockerfile
image
:
lesson/php
container_name
:
app
restart
:
unless-stopped
tty
:
true
environment
:
SERVICE_NAME
:
app
SERVICE_TAGS
:
dev
working_dir
:
/var/www
volumes
:
-
./:/var/www
-
./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks
:
-
app-network
#Nginx Service
webserver
:
image
:
nginx:alpine
container_name
:
webserver
restart
:
unless-stopped
tty
:
true
ports
:
-
"
80:80"
-
"
443:443"
volumes
:
-
./:/var/www
-
./docker/nginx/:/etc/nginx/conf.d/
networks
:
-
app-network
#MySQL Service
db
:
image
:
mysql
container_name
:
db
restart
:
unless-stopped
tty
:
true
environment
:
MYSQL_DATABASE
:
laravel
MYSQL_ROOT_PASSWORD
:
secret
MYSQL_PASSWORD
:
secret
MYSQL_USER
:
lesson_user
SERVICE_TAGS
:
dev
SERVICE_NAME
:
mysql
ports
:
-
"
8001:3306"
volumes
:
-
dbdata:/var/lib/mysql
networks
:
-
app-network
#Volumes
volumes
:
dbdata
:
driver
:
local
#Docker Networks
networks
:
app-network
:
driver
:
bridge
docker/nginx/app.conf
0 → 100644
View file @
a070d48c
server
{
listen
80
;
index
index
.
php
;
error_log
/
var
/
log
/
nginx
/
error
.
log
;
access_log
/
var
/
log
/
nginx
/
access
.
log
;
root
/
var
/
www
/
public
;
location
~ \.
php
$ {
try_files
$
uri
=
404
;
fastcgi_split_path_info
^(.+\.
php
)(/.+)$;
fastcgi_pass
app
:
9000
;
fastcgi_index
index
.
php
;
include
fastcgi_params
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
fastcgi_param
PATH_INFO
$
fastcgi_path_info
;
}
location
/ {
try_files
$
uri
$
uri
/ /
index
.
php
?$
query_string
;
gzip_static
on
;
}
}
docker/php/local.ini
0 → 100644
View file @
a070d48c
max_execution_time
=
60
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment