by Timo Stankowitz [email protected]
If you have any questions of any suggestions just reach out to me.
Don't create an extra directory. Comperser will do this for you. The folder name will be project-name (change to your actual project name).
docker run -u 1000 ---rm -v $(pwd):/app composer/composer create-project --prefer-dist laravel/laravel *project-name*
This can take you up to 5 minutes.
cp .env.example .env You can copy and paste the first part of the example file.
This is required. Otherwise your application will not start. Use php artisan for that:
docker run --rm -v $(pwd):/mount php php /mount/artisan key:generate
upcomming
The simplest way is to create a Dockerfile in you root directory with touch Dockerfile. Copy and paste the following content:
FROM php
LABEL maintainer="Timo Stankowitz <[email protected]>"
COPY ./ /mount
WORKDIR /mount
ENTRYPOINT ["php", "artisan", "serve"]
Per default your application will run on port 8000. Just go to http://localhost:8000 to check if your application is running.
If you want to change the port just replace the list line with this: ENTRYPOINT ["php", "artisan", "serve", "--port=80"]. In this example your port will be 80.
version: '3'
services:
  project-name:
    build: .
    network_mode: 'host'
    volumes:
      - ./:/mount
and run docker-compose up