File tree Expand file tree Collapse file tree 5 files changed +44
-13
lines changed Expand file tree Collapse file tree 5 files changed +44
-13
lines changed Original file line number Diff line number Diff line change 14
14
- name : Run docker-compose
15
15
run :
16
16
cp ./tests/compose.yaml compose.yaml &&
17
- docker- compose -f "compose.yaml" up -d
17
+ docker compose -f "compose.yaml" up -d
18
18
- name : Create script.js for K6 test
19
19
run : |
20
20
touch script.js && cat > script.js <<EOF
Original file line number Diff line number Diff line change
1
+ IMAGE_NAME :jkaninda/laravel-php-fpm
2
+ build-8.1 :
3
+ docker buildx build -f src/docker/8.1/Dockerfile -t ${IMAGE_NAME} :8.1 .
4
+ build-8.2 :
5
+ docker buildx build -f src/docker/8.2/Dockerfile -t ${IMAGE_NAME} :8.2 .
6
+ build-8.3 :
7
+ docker buildx build -f src/docker/8.3/Dockerfile -t ${IMAGE_NAME} :8.3 .
Original file line number Diff line number Diff line change @@ -62,15 +62,39 @@ services:
62
62
user : www-data # Use www-data user for production usage
63
63
volumes :
64
64
# Project root
65
- - ./:/var/www/html
65
+ - ./src :/var/www/html
66
66
networks :
67
67
- default # if you're using networks between containers
68
68
69
69
```
70
- ## Laravel ` artisan ` command usage:
71
- ### Open php-fpm
70
+ ## Docker:
71
+ ### Run
72
+ ``` sh
73
+ docker compose up -d
74
+ ```
75
+ ### Create Laravel project
76
+ ``` sh
77
+ docker compose exec php-fpm composer create-project --prefer-dist laravel/laravel .
78
+ ```
79
+ ### Artisan generate key
80
+ ``` sh
81
+ docker compose exec php-fpm php artisan key:generate
82
+ ```
83
+ ### Storage link
72
84
``` sh
73
- docker compose exec php-fpm /bin/bash
85
+ docker compose exec php-fpm php artisan storage:link
86
+ ```
87
+ ### Fix permissions
88
+ ``` sh
89
+ docker compose exec php-fpm chmod -R 777 storage bootstrap/cache
90
+ ```
91
+ ### Laravel migration
92
+ ``` sh
93
+ docker compose exec php-fpm php artisan migrate
94
+ ```
95
+ ###
96
+ ``` sh
97
+ docker exec -it php-fpm bash
74
98
75
99
```
76
100
@@ -82,7 +106,6 @@ docker compose exec php-fpm /bin/bash
82
106
## Example Laravel-php-fpm with nginx:
83
107
### docker-compose.yml
84
108
``` yml
85
- version : ' 3'
86
109
services :
87
110
php-fpm :
88
111
image : jkaninda/laravel-php-fpm
@@ -151,7 +174,6 @@ server {
151
174
## Advanced Laravel-php-fpm with nginx:
152
175
### docker-compose.yml
153
176
``` yml
154
- version : ' 3'
155
177
services :
156
178
php-fpm :
157
179
image : jkaninda/laravel-php-fpm
@@ -183,7 +205,7 @@ volumes:
183
205
184
206
## Docker run
185
207
` ` ` sh
186
- docker- compose up -d
208
+ docker compose up -d
187
209
188
210
```
189
211
## Build from base
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ FROM php:8.1-fpm
2
2
ARG WORKDIR=/var/www/html
3
3
ENV DOCUMENT_ROOT=${WORKDIR}
4
4
ENV LARAVEL_PROCS_NUMBER=1
5
- ENV NODE_VERSION=17.x
5
+ ENV NODE_MAJOR=20
6
6
ARG GROUP_ID=1000
7
7
ARG USER_ID=1000
8
8
ENV USER_NAME=www-data
@@ -28,9 +28,11 @@ RUN apt-get update && apt-get install -y \
28
28
nano \
29
29
cron
30
30
31
- RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
32
- # Install Node
33
- RUN apt-get install -y nodejs
31
+ # Install Nodejs
32
+ RUN apt-get update && apt-get install -y ca-certificates curl gnupg
33
+ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
34
+ RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
35
+ RUN apt-get update && apt-get install nodejs -y
34
36
35
37
# Clear cache
36
38
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
Original file line number Diff line number Diff line change 1
- FROM php:8.3.3 -fpm
1
+ FROM php:8.3.4 -fpm
2
2
ARG WORKDIR=/var/www/html
3
3
ENV DOCUMENT_ROOT=${WORKDIR}
4
4
ENV LARAVEL_PROCS_NUMBER=1
You can’t perform that action at this time.
0 commit comments