Skip to content

Commit

Permalink
feat: add scheduled task runner
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jan 30, 2024
1 parent 793f86b commit 3773efd
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
x-environment: &env
x-environment: &shopware
environment:
APP_ENV: prod
DATABASE_URL: 'mysql://shopware:shopware@database/shopware'
Expand All @@ -7,6 +7,12 @@ x-environment: &env
APP_SECRET: 'test'
JWT_PRIVATE_KEY: 'LS0tLS1CRUdJTiBFTkNSWVBURUQgUFJJVkFURSBLRVktLS0tLQpNSUlGSERCT0Jna3Foa2lHOXcwQkJRMHdRVEFwQmdrcWhraUc5dzBCQlF3d0hBUUlFOE5rWmE0ck1PVUNBZ2dBCk1Bd0dDQ3FHU0liM0RRSUpCUUF3RkFZSUtvWklodmNOQXdjRUNQeHVabVIrWWV6QUJJSUV5QVVPM0pBcjV5K0QKTDRvTzRGM0JlL1Z1Slp5QlRPRFdQcU1BNzZ2SUF4K3lDUmZBTVIxRWw4MlNwRUdiSUZVSTA0VTRqUERTeER6aAoxd2dkemQyZHJSMjl2UCtKdjl3ekhjbDBib3g1dnd0ZmFxdEdFcjg0UnQ5aTl5aHpINkJ3MnZMQ21NQVNac0pPCjVrNEdERnhSTDhudWxTVXZtcjA1RUNnVEdQMndraXMzRThtRTU0Q3UrSlpLVzFwN0lkcmdJd3BSSWwwNUhLWVAKSFRGbGJaNURpb3dFelF3Qm42K25TbE40OUJneE1ZM1cxdkhrWTRDaVdZNUJTOENYcHoweGRvNnBzSTRuZ2dpLwpId2xBTVpDVGQvdFZnMW5VMkdRcGNRTkpPZm1TSW0xcWlNeGpSbE5iV2tIbmMvMkwya3AveWs5cFo4aTIwTFhrCnYxZHVHNUZvclRsL1JyNnE0SWtBV1FNbUZUcDdNanpzbmozMDB3SkcwTDREUDFXQTN4VVNKbDQ2SlRVZU9IcncKbEJxZ2xZQ0tPaFVWM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Uh2cnkwRnByUQoyaG5VUDdMZThlbU1FeUJtTzBGeHoyYVdsVEo4d3FmVDdMRUYyNVJOaERoNyswc3JJSC9RcnlpRHhVZnBvZTBpCkNLNUVpZVdHMXloeXhMMUZJU2JTVmIvRGZaWHo3NGYzMWp0VWpEaVJuWjF2U0UxNDNGKzdUaFV3alBra0pYcVEKQlFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg=='
volumes:
- files:/var/www/html/files
- theme:/var/www/html/public/theme
- media:/var/www/html/public/media
- thumbnail:/var/www/html/public/thumbnail
- sitemap:/var/www/html/public/sitemap

services:
database:
Expand All @@ -25,23 +31,15 @@ services:

init-perm:
image: alpine
<<: *env
volumes:
- files:/var/www/html/files
- theme:/var/www/html/public/theme
- media:/var/www/html/public/media
- thumbnail:/var/www/html/public/thumbnail
- sitemap:/var/www/html/public/sitemap
<<: *shopware
command: chown 82:82 /var/www/html/files /var/www/html/public/theme /var/www/html/public/media /var/www/html/public/thumbnail /var/www/html/public/sitemap

init:
image: local
<<: *env
<<: *shopware
build:
context: .
entrypoint: /setup
volumes_from:
- init-perm
depends_on:
database:
condition: service_healthy
Expand All @@ -50,11 +48,9 @@ services:

web:
image: local
<<: *env
<<: *shopware
build:
context: .
volumes_from:
- init
depends_on:
init:
condition: service_completed_successfully
Expand All @@ -63,23 +59,31 @@ services:

worker:
image: local
<<: *env
<<: *shopware
restart: unless-stopped
build:
context: .
volumes:
- files:/var/www/html/files
- theme:/var/www/html/public/theme
- media:/var/www/html/public/media
- thumbnail:/var/www/html/public/thumbnail
- sitemap:/var/www/html/public/sitemap
volumes_from:
- init
depends_on:
init:
condition: service_completed_successfully
entrypoint: [ "php", "bin/console", "messenger:consume", "async", "--time-limit=300", "--memory-limit=512M" ]
deploy:
replicas: 3

scheduled-task:
image: local
<<: *shopware
restart: unless-stopped
build:
context: .
volumes_from:
- init
depends_on:
init:
condition: service_completed_successfully
entrypoint: [ "php", "bin/console", "scheduled-task:run" ]
volumes:
mysql-data:
files:
Expand Down

0 comments on commit 3773efd

Please sign in to comment.