Menu

Docker with CLI

Docker Image can be found here .

Installation

  • wget -O .env https://raw.githubusercontent.com/fr0tt/benotes/master/.env.sqlite.example

    copy the content of this file into a new file called .env

  • edit .env by setting a random secret for APP_KEY (generated with e.g. openssl rand -base64 32 ) and JWT_SECRET
  • only if you do not want to use SQLite: also edit DB_DATABASE , DB_HOST , DB_USERNAME , DB_PASSWORD , DB_CONNECTION and DB_PORT according to your database. (You can have a look at classic for this)
  • docker run -p 8000:80 -itd --rm \
        -v benotes_storage:/var/www/storage \
        -v "$(pwd)"/nginx/logs/:/var/lib/nginx/logs/ \
        -v "$(pwd)"/.env:/var/www/.env \
        --env-file ./.env \
        --name benotes fr0tt/benotes

    run the docker container (with a named volume to store data, a bind mount for webserver logs and env variables from your .env file)

  • docker exec -it benotes sh

    reference the image by its name, in this case as previously defined: benotes

  • php artisan install --only-user

    execute those two commands in your container to initialize the application

Upgrade

  • rerun the container in order to use the latest build


Optional: S3 as Filesystem

If you use an ephermal, non-persistent filesystem which is the case e.g. with Heroku or every Docker hosting that does not implement volumes you can use the S3 driver in order to store your data permanently.

What benefit would you gain from doing so ?

Currently the only difference would be that every thumbnail from every link would use the original location of every thumbnail, meaning that your browser would need to communicate with each of them - instead of accessing them all shrinked and from on single source, your local filesystem or a S3 bucket. Every Object Storage that is S3 compliant can be used such as e.g. AWS S3, Digital Ocean Spaces or Minio.
  • Create a bucket and make it public
  • Add to your .env file the following with correct corresponding values:
FILESYSTEM_DRIVER     = s3
AWS_ACCESS_KEY_ID     = yourKeyId
AWS_SECRET_ACCESS_KEY = yourAccessKey
AWS_DEFAULT_REGION    = us-east-1
AWS_BUCKET            = yourCreativeBucketName
AWS_ENDPOINT          = endpointUrl