Skip to content

Commit

Permalink
Allow overriding container restart policy
Browse files Browse the repository at this point in the history
  • Loading branch information
markmetcalfe committed Dec 16, 2024
1 parent 9877aeb commit a9d6674
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ LOCAL_SRC=/your/totara/src/path
# Note that specifying just 'php' will automatically use the latest version of PHP that the Totara site supports
DEFAULT_CONTAINERS=nginx,pgsql13,php

# Set the restart policy for containers
# If set to 'no', containers will only start when you manually start them via `tup`
# If set to 'unless-stopped', containers will restart upon rebooting/crashing
RESTART_POLICY=unless-stopped

# set this to your local IP address
# for mac just use "host.docker.internal"
# for linux run command "docker run --rm alpine ip -4 route list match 0/0 | cut -d' ' -f3" and use the resulting ip address
Expand Down
1 change: 1 addition & 0 deletions compose/apache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
apache:
image: totara/docker-dev-apache
container_name: totara_apache
restart: ${RESTART_POLICY:-no}
environment:
- TZ=${TIME_ZONE}
- REMOTE_DATA
Expand Down
1 change: 1 addition & 0 deletions compose/machine-learning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
build:
context: ${ML_TOTARA_PROJECT:?Set the path to your Totara project}/extensions/ml_service
target: mlbase
restart: ${RESTART_POLICY:-no}
init: true
pull_policy: build
environment:
Expand Down
9 changes: 9 additions & 0 deletions compose/mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
mariadb1104:
image: mariadb:11.4
container_name: totara_mariadb1104
restart: ${RESTART_POLICY:-no}
ports:
- "3316:3306"
environment:
Expand All @@ -19,6 +20,7 @@ services:
mariadb1011:
image: mariadb:10.11
container_name: totara_mariadb1011
restart: ${RESTART_POLICY:-no}
ports:
- "3315:3306"
environment:
Expand All @@ -35,6 +37,7 @@ services:
mariadb108:
image: mariadb:10.8
container_name: totara_mariadb108
restart: ${RESTART_POLICY:-no}
ports:
- "3312:3306"
environment:
Expand All @@ -51,6 +54,7 @@ services:
mariadb107:
image: mariadb:10.7
container_name: totara_mariadb107
restart: ${RESTART_POLICY:-no}
ports:
- "3311:3306"
environment:
Expand All @@ -67,6 +71,7 @@ services:
mariadb106:
image: mariadb:10.6
container_name: totara_mariadb106
restart: ${RESTART_POLICY:-no}
ports:
- "3310:3306"
environment:
Expand All @@ -83,6 +88,7 @@ services:
mariadb105:
image: mariadb:10.5
container_name: totara_mariadb105
restart: ${RESTART_POLICY:-no}
ports:
- "3307:3306"
environment:
Expand All @@ -99,6 +105,7 @@ services:
mariadb104:
image: mariadb:10.4
container_name: totara_mariadb104
restart: ${RESTART_POLICY:-no}
ports:
- "3309:3306"
environment:
Expand All @@ -115,6 +122,7 @@ services:
mariadb103:
image: mariadb:10.3
container_name: totara_mariadb103
restart: ${RESTART_POLICY:-no}
ports:
- "3305:3306"
environment:
Expand All @@ -131,6 +139,7 @@ services:
mariadb102:
image: mariadb:10.2
container_name: totara_mariadb102
restart: ${RESTART_POLICY:-no}
ports:
- "3302:3306"
environment:
Expand Down
3 changes: 3 additions & 0 deletions compose/mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
# Mssql does not support multiple architectures
platform: linux/amd64
container_name: totara_mssql
restart: ${RESTART_POLICY:-no}
ports:
- "1433:1433"
environment:
Expand All @@ -24,6 +25,7 @@ services:
# Mssql does not support multiple architectures
platform: linux/amd64
container_name: totara_mssql2019
restart: ${RESTART_POLICY:-no}
ports:
- "1419:1433"
environment:
Expand All @@ -43,6 +45,7 @@ services:
# Mssql does not support multiple architectures
platform: linux/amd64
container_name: totara_mssql2022
restart: ${RESTART_POLICY:-no}
ports:
- "1420:1433"
environment:
Expand Down
3 changes: 3 additions & 0 deletions compose/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
mysql8:
image: mysql:8.0
container_name: totara_mysql8
restart: ${RESTART_POLICY:-no}
ports:
- "3308:3306"
environment:
Expand All @@ -19,6 +20,7 @@ services:
mysql84:
image: mysql:8.4
container_name: totara_mysql84
restart: ${RESTART_POLICY:-no}
ports:
- "3309:3306"
environment:
Expand All @@ -37,6 +39,7 @@ services:
platform: linux/amd64
image: mysql:5.7
container_name: totara_mysql57
restart: ${RESTART_POLICY:-no}
ports:
- "3306:3306"
environment:
Expand Down
1 change: 1 addition & 0 deletions compose/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
nginx:
image: totara/docker-dev-nginx
container_name: totara_nginx
restart: ${RESTART_POLICY:-no}
environment:
- TZ=${TIME_ZONE}
- REMOTE_DATA
Expand Down
9 changes: 9 additions & 0 deletions compose/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
pgsql93:
image: postgres:9.3-alpine
container_name: totara_pgsql93
restart: ${RESTART_POLICY:-no}
ports:
- "5493:5432"
environment:
Expand All @@ -21,6 +22,7 @@ services:
pgsql96:
image: postgres:9.6-alpine
container_name: totara_pgsql96
restart: ${RESTART_POLICY:-no}
ports:
- "5496:5432"
environment:
Expand All @@ -40,6 +42,7 @@ services:
pgsql10:
image: postgres:10-alpine
container_name: totara_pgsql10
restart: ${RESTART_POLICY:-no}
ports:
- "5410:5432"
environment:
Expand All @@ -58,6 +61,7 @@ services:
pgsql11:
image: postgres:11-alpine
container_name: totara_pgsql11
restart: ${RESTART_POLICY:-no}
ports:
- "5411:5432"
environment:
Expand All @@ -76,6 +80,7 @@ services:
pgsql12:
image: postgres:12-alpine
container_name: totara_pgsql12
restart: ${RESTART_POLICY:-no}
ports:
- "5432:5432"
environment:
Expand All @@ -94,6 +99,7 @@ services:
pgsql13:
image: postgres:13-alpine
container_name: totara_pgsql13
restart: ${RESTART_POLICY:-no}
ports:
- "5442:5432"
environment:
Expand All @@ -113,6 +119,7 @@ services:
pgsql14:
image: postgres:14-alpine
container_name: totara_pgsql14
restart: ${RESTART_POLICY:-no}
ports:
- "5443:5432"
environment:
Expand All @@ -132,6 +139,7 @@ services:
pgsql15:
image: postgres:15-alpine
container_name: totara_pgsql15
restart: ${RESTART_POLICY:-no}
ports:
- "5444:5432"
environment:
Expand All @@ -151,6 +159,7 @@ services:
pgsql16:
image: postgres:16-alpine
container_name: totara_pgsql16
restart: ${RESTART_POLICY:-no}
ports:
- "5445:5432"
environment:
Expand Down
Loading

0 comments on commit a9d6674

Please sign in to comment.