Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4b1b0a5

Browse files
authored
Merge pull requestaschmelyun#7 from aschmelyun/v2
V2
2 parents7dd9baf +02fb7e7 commit4b1b0a5

File tree

4 files changed

+50
-8
lines changed

4 files changed

+50
-8
lines changed

‎Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM php:7.2-fpm-alpine
22

3-
WORKDIR /var/www
3+
WORKDIR /var/www/html
44

55
RUN docker-php-ext-install pdo pdo_mysql

‎README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ A pretty simplified docker-compose workflow that sets up a LEMP network of conta
44

55
##Usage
66

7-
To get started, make sure you have[Docker installed](https://docs.docker.com/docker-for-mac/install/) on your system, and then clone this repository. Add your entire Laravel project to the`src` folder, then open a terminal and from this cloned respository's root run`docker-compose build && docker-compose up -d`.
7+
To get started, make sure you have[Docker installed](https://docs.docker.com/docker-for-mac/install/) on your system, and then clone this repository.
88

9-
Open up your browser of choice to[http://localhost:8080](http://localhost:8080) and you should see your Laravel app running as intended.
9+
Add your entire Laravel project to the`src` folder, then open a terminal and from this cloned respository's root run`docker-compose up -d --build`.Open up your browser of choice to[http://localhost:8080](http://localhost:8080) and you should see your Laravel app running as intended.
1010

11-
Containers created and their ports are as follows:
11+
**New:** Three new containers have been added that handle Composer, NPM, and Artisan commands without having to have these platforms installed on your local computer. Use the following command templates from your project root, modifiying them to fit your particular use case:
12+
13+
-`docker-compose run --rm composer update`
14+
-`docker-compose run --rm npm run dev`
15+
-`docker-compose run --rm artisan migrate`
16+
17+
Containers created and their ports (if used) are as follows:
1218

1319
-**nginx** -`:8080`
1420
-**mysql** -`:3306`
15-
-**php** -`:9000`
21+
-**php** -`:9000`
22+
-**npm**
23+
-**composer**
24+
-**artisan**

‎docker-compose.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
ports:
1111
-"8080:80"
1212
volumes:
13-
-./src:/var/www
13+
-./src:/var/www/html
1414
-./nginx/default.conf:/etc/nginx/conf.d/default.conf
1515
depends_on:
1616
-php
@@ -41,8 +41,41 @@ services:
4141
dockerfile:Dockerfile
4242
container_name:php
4343
volumes:
44-
-./src:/var/www
44+
-./src:/var/www/html
4545
ports:
4646
-"9000:9000"
4747
networks:
4848
-laravel
49+
50+
composer:
51+
image:composer:latest
52+
container_name:composer
53+
volumes:
54+
-./src:/var/www/html
55+
working_dir:/var/www/html
56+
depends_on:
57+
-php
58+
networks:
59+
-laravel
60+
61+
npm:
62+
image:node:13.7
63+
container_name:npm
64+
volumes:
65+
-./src:/var/www/html
66+
working_dir:/var/www/html
67+
entrypoint:['npm']
68+
69+
artisan:
70+
build:
71+
context:.
72+
dockerfile:Dockerfile
73+
container_name:artisan
74+
volumes:
75+
-./src:/var/www/html
76+
depends_on:
77+
-mysql
78+
working_dir:/var/www/html
79+
entrypoint:['/var/www/html/artisan']
80+
networks:
81+
-laravel

‎nginx/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ server {
44
server_name localhost;
55
error_log /var/log/nginx/error.log;
66
access_log /var/log/nginx/access.log;
7-
root /var/www/public;
7+
root /var/www/html/public;
88

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp