Skip to content

Commit ed0802e

Browse files
Resolved conflict with ekwav's docker PR
2 parents a049c05 + dc9920d commit ed0802e

3 files changed

Lines changed: 29 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
10+
### Changed
11+
- Updated Docker `README.md`.
12+
913
### Fixed
10-
- Corrected Docker `README.md` to refer to updated `sprinkles.json` and `sprinkles.example.json` locations.
1114
- Replaced `libpng12-dev` which has been dropped since Ubuntu 16.04 with `libpng-dev` in PHP `Dockerfile`.
1215

1316
## v4.1.21

docker/README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
First, install [Docker Compose](https://docs.docker.com/compose/install/).
44

55
Second, initialize a new UserFrosting project:
6-
7-
1. Copy `app/sprinkles.example.json` to `app/sprinkles.json`
8-
2. Run `chmod 777 app/{logs,cache,sessions}` to fix file permissions for web server. (NOTE: File
9-
permissions should be properly secured in a production environment!)
10-
2. Run `docker-compose run composer install` to install all composer modules.
11-
3. Run `docker-compose run node npm install` to install all npm modules.
6+
1. Clone the repository `git clone https://github.com/userfrosting/UserFrosting.git .` and change into that directory `cd userfrosting`
7+
1. Run `cp app/sprinkles.example.json app/sprinkles.json` or upload your own (also upload your sprinkles if you have some)
8+
2. Run `sudo chown -R 33 app/{logs,cache,sessions}` (Changes the user to the www-data user of the image, more information [here](https://serversforhackers.com/c/dckr-file-permissions) )
9+
2. Run `sudo docker-compose run composer install` to install all composer modules.
10+
3. Run `sudo docker-compose run node npm install` to install all npm modules.
1211

1312
Now you can start up the entire Nginx + PHP + MySQL stack using docker with:
1413

15-
$ docker-compose up
14+
$ sudo docker-compose up -d
1615

17-
On the first run you need to init the database (your container name may be different depending on the name of your root directory):
16+
On the first run you need to init the database (Be sure to execute this in the same directory, `${PWD##*/}` is a statement to get your current working directorys name. Docker uses it to name your container):
1817

19-
$ docker exec -it -u www-data userfrosting_php_1 bash -c 'php bakery migrate'
18+
$ sudo docker exec -it -u www-data ${PWD##*/}_php_1 bash -c 'php bakery migrate'
2019

21-
You also need to setup the first admin user (again, your container name may be different depending on the name of your root directory):
20+
You also need to setup the first admin user (again, `${PWD##*/}` is a statement to get your current working directorys name):
2221

23-
$ docker exec -it -u www-data userfrosting_php_1 bash -c 'php bakery create-admin'
22+
$ sudo docker exec -it -u www-data ${PWD##*/}_php_1 bash -c 'php bakery create-admin'
2423

2524
Now visit http://localhost:8570/ to see your UserFrosting homepage!
2625

@@ -33,3 +32,17 @@ You may be tempted to run with this in production but this setup has not been se
3332
- Database credentials are hard-coded so obviously not secure.
3433
- File permissions may be more open than necessary.
3534
- It just hasn't been thoroughly tested in the capacity of being a production system.
35+
36+
## Updating your code
37+
As you might guessed you will have to run
38+
39+
$ sudo docker exec -it -u www-data userfrosting_php_1 bash -c 'php bakery migrate'
40+
41+
again if you want to migrate tables.
42+
You can change `php bakery migrate` to other `bakery` commands as well.
43+
Be aware that the userfrosting container doesn't know about npm!
44+
Similary for composer:
45+
46+
$ sudo docker-compose run composer update
47+
48+
See the [Docker](https://docs.docker.com/engine) and [Docker-compose documentation](https://docs.docker.com/compose/) for more details.

docker/php/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.0-fpm
1+
FROM php:7.2-fpm
22
RUN apt-get update && apt-get install -y \
33
libfreetype6-dev \
44
libjpeg62-turbo-dev \

0 commit comments

Comments
 (0)