From a84ec51b3f16ec973dd5c2995b11bff4a5515705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Lo=CC=88sken?= Date: Tue, 12 May 2020 14:57:25 +0200 Subject: [PATCH] Restructure docker-compose * Use alpine images * Remove separate directory * Give more hints in docker-compose file --- .editorconfig | 24 ++++++ .../nginx.conf => config/nginx/default.conf | 0 docker-compose.yml | 84 +++++++++++++++++++ docker-compose/.env.example | 17 ---- docker-compose/docker-compose.yml | 72 ---------------- 5 files changed, 108 insertions(+), 89 deletions(-) create mode 100644 .editorconfig rename docker-compose/nginx.conf => config/nginx/default.conf (100%) create mode 100644 docker-compose.yml delete mode 100644 docker-compose/.env.example delete mode 100644 docker-compose/docker-compose.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d89975c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.*] +charset = utf-8 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +# Matches the files *.yml +[*.yml] +indent_style = space +indent_size = 2 + diff --git a/docker-compose/nginx.conf b/config/nginx/default.conf similarity index 100% rename from docker-compose/nginx.conf rename to config/nginx/default.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a3691be --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,84 @@ +version: '3.6' + +services: + nginx: + image: nginx:alpine + restart: always + volumes: + # Vhost configuration + - ./config/nginx/default.conf:/etc/nginx/conf.d/default.conf + + # Configure your mounted directories, make sure the folder 'public' and 'storage' + # exist, before mounting them + - public:/var/www/app/public + - storage:/var/www/app/storage + # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! + # - ./docker/app/public:/var/www/app/public:rw,delegated + # - ./docker/app/storage:/var/www/app/storage:rw,delegated + depends_on: + - app + # Run webserver nginx on port 80 + # Feel free to modify depending what port is already occupied + ports: + - "80:80" + networks: + - invoiceninja + + app: + image: invoiceninja/invoiceninja:alpine + restart: always + environment: + + volumes: + # Configure your mounted directories, make sure the folder 'public' and 'storage' + # exist, before mounting them + - public:/var/www/app/public + - storage:/var/www/app/storage + # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! + # - ./docker/app/public:/var/www/app/public:rw,delegated + # - ./docker/app/storage:/var/www/app/storage:rw,delegated + depends_on: + - db + networks: + - invoiceninja + + db: + image: mysql:5 + restart: always + volumes: + - mysql-data:/var/lib/mysql:rw + # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! + # - ./docker/mysql/data:/var/lib/mysql:rw,delegated + networks: + - invoiceninja + + + cron: + image: invoiceninja/invoiceninja + env_file: .env + volumes: + - storage:/var/www/app/storage + - logo:/var/www/app/public/logo + - public:/var/www/app/public + entrypoint: | + bash -c 'bash -s <