simplified deployment with docker (#639)

* updated Dockerfile and docker-compose.yml, replaced cron with ofelia and setup.sh with automatically executed startup.sh

* fixed permissions by setting them in setup-script
This commit is contained in:
LU-386
2022-03-16 13:59:21 +01:00
committed by GitHub
parent 18507ddb6f
commit e03320d27b
6 changed files with 46 additions and 54 deletions

View File

@ -1,25 +1,22 @@
version: '3'
services:
app:
build:
args:
user: crater-user
uid: 1000
context: ./
dockerfile: Dockerfile
image: crater-php
build: .
image: craterapp/crater
restart: unless-stopped
working_dir: /var/www/
volumes:
- ./:/var/www
- ./docker-compose/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:rw,delegated
- ./:/var/www:z
labels:
ofelia.enabled: "true"
ofelia.job-exec.somecron.schedule: "@every 60s"
ofelia.job-exec.somecron.command: "php artisan schedule:run"
networks:
- crater
db:
image: mariadb
restart: always
restart: unless-stopped
volumes:
- db:/var/lib/mysql
# If you want to persist data on the host, comment the line above this one...
@ -41,19 +38,19 @@ services:
ports:
- 80:80
volumes:
- ./:/var/www
- ./docker-compose/nginx:/etc/nginx/conf.d/
- ./:/var/www:z
- ./docker-compose/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- crater
cron:
build:
context: ./
dockerfile: ./docker-compose/cron.dockerfile
ofelia:
image: mcuadros/ofelia
restart: unless-stopped
command: daemon --docker
volumes:
- ./:/var/www
networks:
- crater
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- app
volumes:
db: