Browse Source

init

master
Lim Eng Shun 1 year ago
commit
11b8be04ad
7 changed files with 104 additions and 0 deletions
  1. 4
    0
      .env.example
  2. 3
    0
      .gitignore
  3. 2
    0
      composer-cache/.gitignore
  4. 4
    0
      database.env.example
  5. 85
    0
      docker-compose.yml
  6. 5
    0
      fpm.env.example
  7. 1
    0
      php.env.example

+ 4
- 0
.env.example View File

@@ -0,0 +1,4 @@
1
+LARAVEL_MEM_LIMIT=5G
2
+LARAVEL_PORT="127.0.0.1:8080:80"
3
+MYSQL_PORT="127.0.0.1:23306:3306"
4
+TZ=Asia/Kuala_Lumpur

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
1
+*.env
2
+src/
3
+database/

+ 2
- 0
composer-cache/.gitignore View File

@@ -0,0 +1,2 @@
1
+**
2
+!.gitignore

+ 4
- 0
database.env.example View File

@@ -0,0 +1,4 @@
1
+MYSQL_ROOT_PASSWORD=laravel-docker
2
+MYSQL_DATABASE=laravel
3
+MYSQL_USER=laravel
4
+MYSQL_PASSWD=laravel-docker

+ 85
- 0
docker-compose.yml View File

@@ -0,0 +1,85 @@
1
+version: "3.7"
2
+services:
3
+  laravel:
4
+    image: eslym/laravel-ca:build4
5
+    depends_on:
6
+      - database
7
+      - redis
8
+    ports:
9
+      - ${LARAVEL_PORT}
10
+    deploy:
11
+      mode: global
12
+      resources:
13
+        limits:
14
+          memory: ${LARAVEL_MEM_LIMIT}
15
+    restart: always
16
+    logging:
17
+      driver: "json-file"
18
+      options:
19
+        max-file: "5"
20
+        max-size: 10m
21
+    networks:
22
+      - laravel-network
23
+    volumes:
24
+      - type: bind
25
+        source: ./src
26
+        target: /var/www/html
27
+      - type: bind
28
+        source: ./composer-cache
29
+        target: /root/.composer/cache
30
+    env_file:
31
+      - ./php.env
32
+      - ./fpm.env
33
+    environment:
34
+      - COMPOSER_INSTALL=no-dev
35
+      - TZ=${TZ}
36
+  redis:
37
+    image: redis:alpine
38
+    deploy:
39
+      mode: global
40
+    restart: always
41
+    logging:
42
+      driver: "json-file"
43
+      options:
44
+        max-file: "5"
45
+        max-size: 10m
46
+    networks:
47
+      laravel-network:
48
+        aliases:
49
+          - redis
50
+    volumes:
51
+    - type: volume
52
+      source: redis-data
53
+      target: /data
54
+    environment:
55
+      - TZ=${TZ}
56
+  database:
57
+    image: mysql:5.7
58
+    ports:
59
+      - ${MYSQL_PORT}
60
+    deploy:
61
+      mode: global
62
+    restart: always
63
+    logging:
64
+      driver: "json-file"
65
+      options:
66
+        max-file: "5"
67
+        max-size: 10m
68
+    networks:
69
+      laravel-network:
70
+        aliases:
71
+            - database
72
+    volumes:
73
+      - type: bind
74
+        source: ./database
75
+        target: /var/lib/mysql
76
+    env_file:
77
+      - ./database.env
78
+    environment:
79
+      - TZ=${TZ}
80
+volumes:
81
+  redis-data:
82
+    driver: local
83
+networks:
84
+  laravel-network:
85
+    driver: bridge

+ 5
- 0
fpm.env.example View File

@@ -0,0 +1,5 @@
1
+# PHP FPM Environments
2
+
3
+#FPM_MAX_CHILDREN=
4
+#FPM_PROCESS_TIMEOUT=
5
+#FPM_MAX_REQUESTS=

+ 1
- 0
php.env.example View File

@@ -0,0 +1 @@
1
+PHP_POST_MAX_SIZE=5M

Loading…
Cancel
Save