Skip to content

Commit a0b0854

Browse files
authored
Merge pull request #3 from sourceboat/feature/dev_example
add development usage example
2 parents 9451eaa + b68a71c commit a0b0854

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,61 @@ A highly opinionated docker image which aims to be perfectly suited to run our L
1414

1515
## Usage
1616

17+
### Development
18+
19+
Create a `Dockerfile` with the following contents (and adjust version tag):
20+
21+
```
22+
FROM sourceboat/docker-laravel:x.x.x
23+
24+
# install yarn dependencies
25+
COPY package.json yarn.* ./
26+
RUN yarn install --pure-lockfile
27+
28+
# copy application
29+
COPY . ./
30+
31+
# install composer dependencies
32+
RUN composer install -d /opt/app --prefer-dist --no-progress --no-interaction --optimize-autoloader
33+
34+
# create storage symlink
35+
RUN php artisan storage:link
36+
37+
# build assets
38+
RUN yarn production
39+
```
40+
41+
Create a `docker-compose.yml` with the following contents:
42+
43+
```
44+
version: '3.7'
45+
services:
46+
app:
47+
build: .
48+
restart: unless-stopped
49+
environment:
50+
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
51+
volumes:
52+
- ./:/opt/app:cached
53+
ports:
54+
- "8080:8080"
55+
depends_on:
56+
- mysql
57+
mysql:
58+
image: mysql:8.0
59+
environment:
60+
- "MYSQL_ROOT_PASSWORD=secret"
61+
- "MYSQL_DATABASE=default"
62+
```
63+
64+
Add more services (e.g. `redis`) if needed.
65+
66+
Make sure to adjust your `.env` accordingly and set `APP_URL` to `http://localhost:8080`.
67+
68+
Run `docker-compose up` to start the services.
69+
70+
### Production
71+
1772
`WIP`
1873

1974
## Changelog

0 commit comments

Comments
 (0)