To contribute to this documentation, please submit a pull request to our learn repository.
The relevant files for installing UserFrosting with Docker are docker-compose.yml
, and the contents of docker/
.
First, install Docker Compose.
Second, initialize a new UserFrosting project:
git clone https://github.com/userfrosting/UserFrosting.git userfrosting
cd userfrosting
app/sprinkles.example.json
to app/sprinkles.json
app/.env.example
to app/.env
chmod 777 app/{logs,cache,sessions}
to fix file permissions for web server. (NOTE: File
permissions should be properly secured in a production environment!)docker-compose build --no-cache
to build all the docker containers.docker-compose up -d
to to start all the containers.docker-compose exec app sh -c "composer update"
to install all composer modules used in UserFrosting.docker-compose exec app sh -c "php bakery bake"
to install UserFrosting (database configuration and migrations, creation of admin user, ...). You'll need to provide info to create the admin user.Now visit http://localhost:8591/
to see your UserFrosting homepage!
You can paste these into a bash file and execute it!
git clone https://github.com/userfrosting/UserFrosting.git userfrosting
cd userfrosting
cp app/sprinkles.example.json app/sprinkles.json
cp app/.env.example app/.env
chmod 777 app/{logs,cache,sessions}
docker-compose build --no-cache
docker-compose up -d
docker-compose exec app sh -c "composer update"
docker-compose exec app sh -c "php bakery bake"
Start / stop containers
If you need to stop the UserFrosting docker containers, just change to your userfrosting directory and run:
docker-compose stop
To start containers again, change to your userfrosting directory and run:
docker-compose up -d
Purge docker containers to start over
If you need to purge your docker containers (this will not delete any source file or sprinkle, but will empty the database), run:
docker-compose down --remove-orphans
And then start the installation process again.
This is not (yet) meant for production!
You may be tempted to run with this in production but this setup has not been security-hardened. For example:
ufw
so this should not be exposed in production.