[{"data":1,"prerenderedAt":1048},["ShallowReactive",2],{"navigation":3,"/docs/customizing-the-image/adding-your-own-start-up-scripts":229,"/docs/customizing-the-image/adding-your-own-start-up-scripts-surround":1043},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","/docs","docs",[9,12,56,85,132,153,186,203,216],{"title":10,"path":6,"stem":11},"","docs/index",{"title":13,"path":14,"stem":15,"children":16,"icon":55},"Getting Started","/docs/getting-started","docs/1.getting-started/1.index",[17,19,23,27,31,35,39,43,47,51],{"title":18,"path":14,"stem":15},"Introduction",{"title":20,"path":21,"stem":22},"Container Basics","/docs/getting-started/container-basics","docs/1.getting-started/2.container-basics",{"title":24,"path":25,"stem":26},"Installation","/docs/getting-started/installation","docs/1.getting-started/3.installation",{"title":28,"path":29,"stem":30},"These Images vs Others","/docs/getting-started/these-images-vs-others","docs/1.getting-started/4.these-images-vs-others",{"title":32,"path":33,"stem":34},"Choosing an Image","/docs/getting-started/choosing-an-image","docs/1.getting-started/5.choosing-an-image",{"title":36,"path":37,"stem":38},"Default Configurations","/docs/getting-started/default-configurations","docs/1.getting-started/6.default-configurations",{"title":40,"path":41,"stem":42},"Upgrade Guide","/docs/getting-started/upgrade-guide","docs/1.getting-started/7.upgrade-guide",{"title":44,"path":45,"stem":46},"Changelog","/docs/getting-started/changelog","docs/1.getting-started/8.changelog",{"title":48,"path":49,"stem":50},"About","/docs/getting-started/about","docs/1.getting-started/9.about",{"title":52,"path":53,"stem":54},"Contributing","/docs/getting-started/contributing","docs/1.getting-started/99.contributing",false,{"title":57,"path":58,"stem":59,"children":60,"page":55},"Image Variations","/docs/image-variations","docs/2.image-variations",[61,65,69,73,77,81],{"title":62,"path":63,"stem":64},"CLI","/docs/image-variations/cli","docs/2.image-variations/cli",{"title":66,"path":67,"stem":68},"FPM","/docs/image-variations/fpm","docs/2.image-variations/fpm",{"title":70,"path":71,"stem":72},"FPM-Apache","/docs/image-variations/fpm-apache","docs/2.image-variations/fpm-apache",{"title":74,"path":75,"stem":76},"FPM-NGINX","/docs/image-variations/fpm-nginx","docs/2.image-variations/fpm-nginx",{"title":78,"path":79,"stem":80},"FrankenPHP","/docs/image-variations/frankenphp","docs/2.image-variations/frankenphp",{"title":82,"path":83,"stem":84},"Unit (Deprecated)","/docs/image-variations/unit","docs/2.image-variations/unit",{"title":86,"path":87,"stem":88,"children":89,"page":55},"Framework Guides","/docs/framework-guides","docs/3.framework-guides",[90,123],{"title":91,"icon":55,"defaultOpen":55,"path":92,"stem":93,"children":94,"page":55},"Laravel","/docs/framework-guides/laravel","docs/3.framework-guides/1.laravel",[95,99,103,107,111,115,119],{"title":96,"path":97,"stem":98},"Automations","/docs/framework-guides/laravel/automations","docs/3.framework-guides/1.laravel/1.automations",{"title":100,"path":101,"stem":102},"Task Scheduler","/docs/framework-guides/laravel/task-scheduler","docs/3.framework-guides/1.laravel/2.task-scheduler",{"title":104,"path":105,"stem":106},"Queue","/docs/framework-guides/laravel/queue","docs/3.framework-guides/1.laravel/3.queue",{"title":108,"path":109,"stem":110},"Horizon","/docs/framework-guides/laravel/horizon","docs/3.framework-guides/1.laravel/4.horizon",{"title":112,"path":113,"stem":114},"Reverb","/docs/framework-guides/laravel/reverb","docs/3.framework-guides/1.laravel/4.reverb",{"title":116,"path":117,"stem":118},"Nightwatch","/docs/framework-guides/laravel/nightwatch","docs/3.framework-guides/1.laravel/5.nightwatch",{"title":120,"path":121,"stem":122},"Octane","/docs/framework-guides/laravel/octane","docs/3.framework-guides/1.laravel/octane",{"title":124,"icon":55,"defaultOpen":55,"path":125,"stem":126,"children":127,"page":55},"WordPress","/docs/framework-guides/wordpress","docs/3.framework-guides/2.wordpress",[128],{"title":129,"path":130,"stem":131},"Using Docker with WordPress","/docs/framework-guides/wordpress/using-wordpress-with-docker","docs/3.framework-guides/2.wordpress/4.using-wordpress-with-docker",{"title":133,"path":134,"stem":135,"children":136,"page":55},"Deployment And Production","/docs/deployment-and-production","docs/4.deployment-and-production",[137,141,145,149],{"title":138,"path":139,"stem":140},"Development to Production","/docs/deployment-and-production/development-to-production","docs/4.deployment-and-production/2.development-to-production",{"title":142,"path":143,"stem":144},"Packaging Your App for Deployment","/docs/deployment-and-production/packaging-your-app-for-deployment","docs/4.deployment-and-production/3.packaging-your-app-for-deployment",{"title":146,"path":147,"stem":148},"Configuring SSL","/docs/deployment-and-production/configuring-ssl","docs/4.deployment-and-production/4.configuring-ssl",{"title":150,"path":151,"stem":152},"Choosing a Host","/docs/deployment-and-production/choosing-a-host","docs/4.deployment-and-production/5.choosing-a-host",{"title":154,"icon":55,"defaultOpen":55,"path":155,"stem":156,"children":157,"page":55},"Advanced Guides","/docs/guide","docs/5.guide",[158,162,166,170,174,178,182],{"title":159,"path":160,"stem":161},"Migrating from official PHP images","/docs/guide/migrating-from-official-php-images","docs/5.guide/1.migrating-from-official-php-images",{"title":163,"path":164,"stem":165},"Using Healthchecks With Laravel","/docs/guide/using-healthchecks-with-laravel","docs/5.guide/2.using-healthchecks-with-laravel",{"title":167,"path":168,"stem":169},"Using S6 Overlay","/docs/guide/using-s6-overlay","docs/5.guide/2.using-s6-overlay",{"title":171,"path":172,"stem":173},"Understanding File Permissions","/docs/guide/understanding-file-permissions","docs/5.guide/3.understanding-file-permissions",{"title":175,"path":176,"stem":177},"Configuring Trusted Proxies","/docs/guide/configuring-trusted-proxies","docs/5.guide/4.configuring-trusted-proxies",{"title":179,"path":180,"stem":181},"Major version migrations","/docs/guide/major-version-migrations","docs/5.guide/5.major-version-migrations",{"title":183,"path":184,"stem":185},"Production performance tuning","/docs/guide/production-performance-tuning","docs/5.guide/6.production-performance-tuning",{"title":187,"icon":55,"defaultOpen":55,"path":188,"stem":189,"children":190,"page":55},"Customization","/docs/customizing-the-image","docs/6.customizing-the-image",[191,195,199],{"title":192,"path":193,"stem":194},"Changing php.ini settings","/docs/customizing-the-image/changing-common-php-settings","docs/6.customizing-the-image/1.changing-common-php-settings",{"title":196,"path":197,"stem":198},"Installing PHP extensions","/docs/customizing-the-image/installing-additional-php-extensions","docs/6.customizing-the-image/2.installing-additional-php-extensions",{"title":200,"path":201,"stem":202},"Adding Start Up Scripts","/docs/customizing-the-image/adding-your-own-start-up-scripts","docs/6.customizing-the-image/3.adding-your-own-start-up-scripts",{"title":204,"path":205,"stem":206,"children":207,"page":55},"Troubleshooting","/docs/troubleshooting","docs/7.troubleshooting",[208,212],{"title":209,"path":210,"stem":211},"Common Issues","/docs/troubleshooting/common-issues","docs/7.troubleshooting/1.common-issues",{"title":213,"path":214,"stem":215},"Getting Help","/docs/troubleshooting/getting-help","docs/7.troubleshooting/2.getting-help",{"title":217,"path":218,"stem":219,"children":220,"page":55},"Reference","/docs/reference","docs/8.reference",[221,225],{"title":222,"path":223,"stem":224},"Environment Variable Specification","/docs/reference/environment-variable-specification","docs/8.reference/1.environment-variable-specification",{"title":226,"path":227,"stem":228},"Command Reference","/docs/reference/command-reference","docs/8.reference/2.command-reference",{"id":230,"title":200,"body":231,"description":1036,"extension":1019,"links":1037,"meta":1038,"navigation":415,"path":201,"redirect":1037,"seo":1041,"stem":202,"__hash__":1042},"docs/docs/6.customizing-the-image/3.adding-your-own-start-up-scripts.md",{"type":232,"value":233,"toc":1027},"minimark",[234,252,257,283,297,301,308,321,325,330,336,350,354,361,552,569,573,580,642,658,662,668,783,788,810,820,824,846,941,951,962,973,1006,1023],[235,236,237],"lead-p",{},[238,239,240,241,246,247,251],"p",{},"We provide a few ",[242,243,245],"a",{"href":244},"/docs/getting-started/default-configurations#default-entrypoint-scripts","default entrypoint scripts"," to get you going, but sometimes you want to just add your own. We've made it easy to do that with our ",[248,249,250],"code",{},"entrypoint.d"," directory.",[253,254,256],"h2",{"id":255},"entrypoint-script-requirements","Entrypoint Script Requirements",[258,259,260,263],"note",{},[238,261,262],{},"Before you write your entry point script, be aware of the following requirements. Your script should:",[264,265,266,270,277],"ul",{},[267,268,269],"li",{},"Be executable (755 permissions)",[267,271,272,273,276],{},"Located in the ",[248,274,275],{},"/etc/entrypoint.d"," directory",[267,278,279,280],{},"Have the file extension ending in ",[248,281,282],{},".sh",[284,285,286],"tip",{},[238,287,288,289,292,293,296],{},"We recommend writing your script in ",[248,290,291],{},"/bin/sh"," for the best compatibility between Alpine and Debian. If you choose to use ",[248,294,295],{},"/bin/bash",", your script will only be able to run on Debian-based images.",[253,298,300],{"id":299},"choose-your-execution-order","Choose your execution order",[238,302,303,304,307],{},"Since ",[242,305,306],{"href":244},"we provide default entrypoint scripts",", you may want to choose the order in which your scripts are executed. We've made it easy to do that by prefixing your script with a number. The lower the number, the earlier it will be executed.",[284,309,310],{},[238,311,312,313,316,317,320],{},"If you want to disable our entrypoint scripts, you can set ",[248,314,315],{},"DISABLE_DEFAULT_CONFIG"," to ",[248,318,319],{},"true"," in your environment variables.",[253,322,324],{"id":323},"long-running-services","Long running services",[258,326,327],{},[238,328,329],{},"Don't use entrypoint scripts for long-running services. You want your services to be monitored and restarted if they crash.",[238,331,332,333,335],{},"Anything in the ",[248,334,275],{}," directory are scripts that are intended to run quickly and then move on. If you run a service as an entrypoint script, that service may crash and not be restarted.",[238,337,338,339,342,343,349],{},"Instead, learn about ",[242,340,341],{"href":168},"using S6 overlay"," so your services can be properly initialized and monitored. See the ",[242,344,348],{"href":345,"rel":346},"https://github.com/just-containers/s6-overlay",[347],"nofollow","S6 Overylay project"," for more details on how to write your own S6 service.",[253,351,353],{"id":352},"example-create-a-custom-entrypoint-script","Example: Create a custom entrypoint script",[238,355,356,357,360],{},"In this example, let's create a ",[248,358,359],{},"99-my-script.sh"," so it executes after all the other default scripts.",[362,363,365,394,432,518],"code-tree",{"default-value":364},"Dockerfile",[366,367,372],"pre",{"className":368,"code":369,"filename":370,"language":371,"meta":10,"style":10},"language-bash shiki shiki-themes github-dark","#!/bin/sh\necho \"👋 Hello, world!\"\n","entrypoint.d/99-my-script.sh","bash",[248,373,374,383],{"__ignoreMap":10},[375,376,379],"span",{"class":377,"line":378},"line",1,[375,380,382],{"class":381},"sAwPA","#!/bin/sh\n",[375,384,386,390],{"class":377,"line":385},2,[375,387,389],{"class":388},"sDLfK","echo",[375,391,393],{"class":392},"sU2Wk"," \"👋 Hello, world!\"\n",[366,395,399],{"className":396,"code":397,"filename":364,"language":398,"meta":10,"style":10},"language-dockerfile shiki shiki-themes github-dark","FROM serversideup/php:8.5-fpm-nginx\n\n# Copy our scripts as executable\nCOPY --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/\n","dockerfile",[248,400,401,411,417,423],{"__ignoreMap":10},[375,402,403,407],{"class":377,"line":378},[375,404,406],{"class":405},"snl16","FROM",[375,408,410],{"class":409},"s95oV"," serversideup/php:8.5-fpm-nginx\n",[375,412,413],{"class":377,"line":385},[375,414,416],{"emptyLinePlaceholder":415},true,"\n",[375,418,420],{"class":377,"line":419},3,[375,421,422],{"class":381},"# Copy our scripts as executable\n",[375,424,426,429],{"class":377,"line":425},4,[375,427,428],{"class":405},"COPY",[375,430,431],{"class":409}," --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/\n",[366,433,438],{"className":434,"code":435,"filename":436,"language":437,"meta":10,"style":10},"language-yml shiki shiki-themes github-dark","services:\n  php:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    ports:\n      - 80:8080\n    volumes:\n      - .:/var/www/html\n","compose.yml","yml",[248,439,440,449,456,463,474,485,493,502,510],{"__ignoreMap":10},[375,441,442,446],{"class":377,"line":378},[375,443,445],{"class":444},"s4JwU","services",[375,447,448],{"class":409},":\n",[375,450,451,454],{"class":377,"line":385},[375,452,453],{"class":444},"  php",[375,455,448],{"class":409},[375,457,458,461],{"class":377,"line":419},[375,459,460],{"class":444},"    build",[375,462,448],{"class":409},[375,464,465,468,471],{"class":377,"line":425},[375,466,467],{"class":444},"      context",[375,469,470],{"class":409},": ",[375,472,473],{"class":388},".\n",[375,475,477,480,482],{"class":377,"line":476},5,[375,478,479],{"class":444},"      dockerfile",[375,481,470],{"class":409},[375,483,484],{"class":392},"Dockerfile\n",[375,486,488,491],{"class":377,"line":487},6,[375,489,490],{"class":444},"    ports",[375,492,448],{"class":409},[375,494,496,499],{"class":377,"line":495},7,[375,497,498],{"class":409},"      - ",[375,500,501],{"class":392},"80:8080\n",[375,503,505,508],{"class":377,"line":504},8,[375,506,507],{"class":444},"    volumes",[375,509,448],{"class":409},[375,511,513,515],{"class":377,"line":512},9,[375,514,498],{"class":409},[375,516,517],{"class":392},".:/var/www/html\n",[366,519,524],{"className":520,"code":521,"filename":522,"language":523,"meta":10,"style":10},"language-php shiki shiki-themes github-dark","\u003C?php\n// Let's just print out some PHP info\nphpinfo();\n?>\n","public/index.php","php",[248,525,526,534,539,547],{"__ignoreMap":10},[375,527,528,531],{"class":377,"line":378},[375,529,530],{"class":405},"\u003C?",[375,532,533],{"class":388},"php\n",[375,535,536],{"class":377,"line":385},[375,537,538],{"class":381},"// Let's just print out some PHP info\n",[375,540,541,544],{"class":377,"line":419},[375,542,543],{"class":388},"phpinfo",[375,545,546],{"class":409},"();\n",[375,548,549],{"class":377,"line":425},[375,550,551],{"class":405},"?>\n",[238,553,554,555,557,558,560,561,564,565,568],{},"In the example above, you can see in the ",[248,556,364],{}," we are copying our ",[248,559,250],{}," directory to ",[248,562,563],{},"/etc/entrypoint.d/"," in the container. We're also setting the permissions to ",[248,566,567],{},"755"," so our scripts are executable.",[253,570,572],{"id":571},"running-our-example","Running our example",[238,574,575,576,579],{},"When we run ",[248,577,578],{},"docker compose up",", we can confirm our script is executing by checking the logs:",[581,582,584],"code-panel",{"label":583},"Output of \"docker compose up\"",[366,585,589],{"className":586,"code":587,"language":588,"meta":10,"style":10},"language-txt shiki shiki-themes github-dark","php-1  | 👉 [NOTICE]: Improve PHP performance by setting PHP_OPCACHE_ENABLE=1 (recommended for production).\nphp-1  | (init-webserver-config): Processing /etc/nginx/nginx.conf.template → /etc/nginx/nginx.conf...\nphp-1  | (init-webserver-config): Processing /etc/nginx/site-opts.d/http.conf.template → /etc/nginx/site-opts.d/http.conf...\nphp-1  | (init-webserver-config): Processing /etc/nginx/site-opts.d/https.conf.template → /etc/nginx/site-opts.d/https.conf...\nphp-1  | ℹ️ NOTICE (init-webserver-config): Enabling NGINX site with SSL \"off\"...\nphp-1  | 👋 Hello, world!\nphp-1  | [03-Nov-2025 19:35:29] NOTICE: fpm is running, pid 93\nphp-1  | [03-Nov-2025 19:35:29] NOTICE: ready to handle connections\nphp-1  | HTTP Status Code: 200\nphp-1  | ✅ NGINX + PHP-FPM is running correctly.\n","txt",[248,590,591,596,601,606,611,616,621,626,631,636],{"__ignoreMap":10},[375,592,593],{"class":377,"line":378},[375,594,595],{},"php-1  | 👉 [NOTICE]: Improve PHP performance by setting PHP_OPCACHE_ENABLE=1 (recommended for production).\n",[375,597,598],{"class":377,"line":385},[375,599,600],{},"php-1  | (init-webserver-config): Processing /etc/nginx/nginx.conf.template → /etc/nginx/nginx.conf...\n",[375,602,603],{"class":377,"line":419},[375,604,605],{},"php-1  | (init-webserver-config): Processing /etc/nginx/site-opts.d/http.conf.template → /etc/nginx/site-opts.d/http.conf...\n",[375,607,608],{"class":377,"line":425},[375,609,610],{},"php-1  | (init-webserver-config): Processing /etc/nginx/site-opts.d/https.conf.template → /etc/nginx/site-opts.d/https.conf...\n",[375,612,613],{"class":377,"line":476},[375,614,615],{},"php-1  | ℹ️ NOTICE (init-webserver-config): Enabling NGINX site with SSL \"off\"...\n",[375,617,618],{"class":377,"line":487},[375,619,620],{},"php-1  | 👋 Hello, world!\n",[375,622,623],{"class":377,"line":495},[375,624,625],{},"php-1  | [03-Nov-2025 19:35:29] NOTICE: fpm is running, pid 93\n",[375,627,628],{"class":377,"line":504},[375,629,630],{},"php-1  | [03-Nov-2025 19:35:29] NOTICE: ready to handle connections\n",[375,632,633],{"class":377,"line":512},[375,634,635],{},"php-1  | HTTP Status Code: 200\n",[375,637,639],{"class":377,"line":638},10,[375,640,641],{},"php-1  | ✅ NGINX + PHP-FPM is running correctly.\n",[238,643,644,645,648,649,653,654,657],{},"You can see our ",[248,646,647],{},"👋 Hello, world!"," is executing ",[650,651,652],"em",{},"after"," the initialization of ",[248,655,656],{},"10-init-webserver-config.sh",".",[253,659,661],{"id":660},"running-custom-artisan-commands","Running Custom Artisan Commands",[238,663,664,665,667],{},"If you need to run a custom artisan command at start up, you could update your ",[248,666,370],{}," file to look like this:",[366,669,671],{"className":368,"code":670,"filename":370,"language":371,"meta":10,"style":10},"#!/bin/sh\n# Check if the artisan file exists\nif [ -f \"$APP_BASE_DIR/artisan\" ]; then\n  # Run the custom artisan command\n  php \"$APP_BASE_DIR/artisan\" my:custom-command\nelse\n  # If the artisan file is not found, stop the container\n  echo \"❌ Artisan file not found in $APP_BASE_DIR\"\n  exit 1\nfi\n\n# Exit with a success code\nexit 0\n",[248,672,673,677,682,708,713,727,732,737,750,758,763,768,774],{"__ignoreMap":10},[375,674,675],{"class":377,"line":378},[375,676,382],{"class":381},[375,678,679],{"class":377,"line":385},[375,680,681],{"class":381},"# Check if the artisan file exists\n",[375,683,684,687,690,693,696,699,702,705],{"class":377,"line":419},[375,685,686],{"class":405},"if",[375,688,689],{"class":409}," [ ",[375,691,692],{"class":405},"-f",[375,694,695],{"class":392}," \"",[375,697,698],{"class":409},"$APP_BASE_DIR",[375,700,701],{"class":392},"/artisan\"",[375,703,704],{"class":409}," ]; ",[375,706,707],{"class":405},"then\n",[375,709,710],{"class":377,"line":425},[375,711,712],{"class":381},"  # Run the custom artisan command\n",[375,714,715,718,720,722,724],{"class":377,"line":476},[375,716,453],{"class":717},"svObZ",[375,719,695],{"class":392},[375,721,698],{"class":409},[375,723,701],{"class":392},[375,725,726],{"class":392}," my:custom-command\n",[375,728,729],{"class":377,"line":487},[375,730,731],{"class":405},"else\n",[375,733,734],{"class":377,"line":495},[375,735,736],{"class":381},"  # If the artisan file is not found, stop the container\n",[375,738,739,742,745,747],{"class":377,"line":504},[375,740,741],{"class":388},"  echo",[375,743,744],{"class":392}," \"❌ Artisan file not found in ",[375,746,698],{"class":409},[375,748,749],{"class":392},"\"\n",[375,751,752,755],{"class":377,"line":512},[375,753,754],{"class":388},"  exit",[375,756,757],{"class":388}," 1\n",[375,759,760],{"class":377,"line":638},[375,761,762],{"class":405},"fi\n",[375,764,766],{"class":377,"line":765},11,[375,767,416],{"emptyLinePlaceholder":415},[375,769,771],{"class":377,"line":770},12,[375,772,773],{"class":381},"# Exit with a success code\n",[375,775,777,780],{"class":377,"line":776},13,[375,778,779],{"class":388},"exit",[375,781,782],{"class":388}," 0\n",[784,785,787],"h4",{"id":786},"best-practices-for-running-custom-artisan-commands","Best practices for running custom artisan commands",[264,789,790,797,800,803],{},[267,791,792,793,292,795,296],{},"Use ",[248,794,291],{},[248,796,295],{},[267,798,799],{},"Check to see if the artisan file exists before running the command",[267,801,802],{},"Exit with a success code",[267,804,805,806,809],{},"Name your file appropriately, so it executes in logic order with the other scripts (see our ",[242,807,808],{"href":244},"default configurations",")",[238,811,812,813,816,817,657],{},"You can change the name of your file to whatever you want, but we recommend using a number prefix to ensure it executes in the correct order. For example, if you want to run a command after the default scripts, you could name your file ",[248,814,815],{},"99-my-command.sh",". If you want to run a command before the default scripts, you could name your file ",[248,818,819],{},"1-my-command.sh",[253,821,823],{"id":822},"advanced-scenarios-s6-overlay-dependencies","Advanced Scenarios: S6 Overlay dependencies",[238,825,826,827,830,831,834,835,837,838,841,842,845],{},"If you want to customize an image that uses S6 Overlay (",[248,828,829],{},"fpm-nginx"," or ",[248,832,833],{},"fpm-apache","), you may have an advanced scenario where you have a custom S6 service that needs to be executed after one of our entrypoint scripts. In order to do this, you'll need to move all our scripts from the ",[248,836,275],{}," directory to the ",[248,839,840],{},"/etc/s6-overlay/scripts"," directory. This would be a very time consuming scenario if you did this manually, but thankfully you can use our ",[248,843,844],{},"docker-php-serversideup-s6-init"," script to do this for you.",[366,847,849],{"className":396,"code":848,"filename":364,"language":398,"meta":10,"style":10},"FROM serversideup/php:8.5-fpm-nginx\n\n# Set the user to root for our build steps\nUSER root\n\n# If you have your own one-shot scripts, copy them to the entrypoint.d directory\nCOPY --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/\n\n# Copy our entrypoint scripts into the S6 Overlay scripts directory\nRUN docker-php-serversideup-s6-init\n\n# If you have your own long running services, copy them to the s6 directory\nCOPY --chmod=755 ./my-s6-service/ /etc/s6-overlay/s6-rc.d/my-s6-service/\n\n# Drop back to the non-root user\nUSER www-data\n",[248,850,851,857,861,866,874,878,883,889,893,898,906,910,915,922,927,933],{"__ignoreMap":10},[375,852,853,855],{"class":377,"line":378},[375,854,406],{"class":405},[375,856,410],{"class":409},[375,858,859],{"class":377,"line":385},[375,860,416],{"emptyLinePlaceholder":415},[375,862,863],{"class":377,"line":419},[375,864,865],{"class":381},"# Set the user to root for our build steps\n",[375,867,868,871],{"class":377,"line":425},[375,869,870],{"class":405},"USER",[375,872,873],{"class":409}," root\n",[375,875,876],{"class":377,"line":476},[375,877,416],{"emptyLinePlaceholder":415},[375,879,880],{"class":377,"line":487},[375,881,882],{"class":381},"# If you have your own one-shot scripts, copy them to the entrypoint.d directory\n",[375,884,885,887],{"class":377,"line":495},[375,886,428],{"class":405},[375,888,431],{"class":409},[375,890,891],{"class":377,"line":504},[375,892,416],{"emptyLinePlaceholder":415},[375,894,895],{"class":377,"line":512},[375,896,897],{"class":381},"# Copy our entrypoint scripts into the S6 Overlay scripts directory\n",[375,899,900,903],{"class":377,"line":638},[375,901,902],{"class":405},"RUN",[375,904,905],{"class":409}," docker-php-serversideup-s6-init\n",[375,907,908],{"class":377,"line":765},[375,909,416],{"emptyLinePlaceholder":415},[375,911,912],{"class":377,"line":770},[375,913,914],{"class":381},"# If you have your own long running services, copy them to the s6 directory\n",[375,916,917,919],{"class":377,"line":776},[375,918,428],{"class":405},[375,920,921],{"class":409}," --chmod=755 ./my-s6-service/ /etc/s6-overlay/s6-rc.d/my-s6-service/\n",[375,923,925],{"class":377,"line":924},14,[375,926,416],{"emptyLinePlaceholder":415},[375,928,930],{"class":377,"line":929},15,[375,931,932],{"class":381},"# Drop back to the non-root user\n",[375,934,936,938],{"class":377,"line":935},16,[375,937,870],{"class":405},[375,939,940],{"class":409}," www-data\n",[238,942,943,944,946,947,950],{},"In the above file, we're copying our \"one-shot\" scripts to the ",[248,945,275],{}," directory and our long running services to the ",[248,948,949],{},"/etc/s6-overlay"," directory. One-shot scripts are scripts that are intended to run quickly and then move on. Long running services are services that are intended to run for a long time and need to be monitored and restarted if they crash.",[238,952,953,954,956,957,837,959,961],{},"The magic happens when we run ",[248,955,844],{},". This script will move all our scripts from the ",[248,958,275],{},[248,960,840],{}," directory and set the correct dependencies for our S6 services.",[238,963,964,965,968,969,972],{},"You can now reference our script names as dependencies in your own S6 service. Declare each dependency as an empty file in your service's ",[248,966,967],{},"dependencies.d"," directory. S6 Overlay recommends every service also depend on ",[248,970,971],{},"base"," to prevent race conditions during container start up.",[366,974,978],{"className":975,"code":976,"language":977,"meta":10,"style":10},"language-sh shiki shiki-themes github-dark","mkdir -p /etc/s6-overlay/s6-rc.d/my-s6-service/dependencies.d\ntouch /etc/s6-overlay/s6-rc.d/my-s6-service/dependencies.d/base\ntouch /etc/s6-overlay/s6-rc.d/my-s6-service/dependencies.d/10-init-webserver-config\n","sh",[248,979,980,991,999],{"__ignoreMap":10},[375,981,982,985,988],{"class":377,"line":378},[375,983,984],{"class":717},"mkdir",[375,986,987],{"class":388}," -p",[375,989,990],{"class":392}," /etc/s6-overlay/s6-rc.d/my-s6-service/dependencies.d\n",[375,992,993,996],{"class":377,"line":385},[375,994,995],{"class":717},"touch",[375,997,998],{"class":392}," /etc/s6-overlay/s6-rc.d/my-s6-service/dependencies.d/base\n",[375,1000,1001,1003],{"class":377,"line":419},[375,1002,995],{"class":717},[375,1004,1005],{"class":392}," /etc/s6-overlay/s6-rc.d/my-s6-service/dependencies.d/10-init-webserver-config\n",[1007,1008],"u-button",{"ariaLabel":1009,"className":1010,"color":1018,"label":1009,"size":1019,"target":1020,"to":345,"trailing-icon":1021,"variant":1022},"Learn more about S6 Overlay",[1011,1012,1013,1014,1015,1016,1017],"font-bold","ring","ring-inset","ring-blue-600","text-blue-600","hover:ring-blue-500","hover:text-blue-500","primary","md","_blank","i-lucide-arrow-right","outline",[1024,1025,1026],"style",{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .s4JwU, html code.shiki .s4JwU{--shiki-default:#85E89D}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}",{"title":10,"searchDepth":385,"depth":385,"links":1028},[1029,1030,1031,1032,1033,1034,1035],{"id":255,"depth":385,"text":256},{"id":299,"depth":385,"text":300},{"id":323,"depth":385,"text":324},{"id":352,"depth":385,"text":353},{"id":571,"depth":385,"text":572},{"id":660,"depth":385,"text":661},{"id":822,"depth":385,"text":823},"Learn how to use our entrypoint.d directory to customize your container start up experience.",null,{"head":1039,"layout":7},{"title":1040},"Adding your own start up scripts - Docker PHP - Server Side Up",{"title":200,"description":1036},"RvDgySIFTuKy1kKO1KT83XC_hoP8YAse406DXj34CaM",[1044,1046],{"title":196,"path":197,"stem":198,"description":1045,"children":-1},"Learn how to add any PHP extension that you need for your application.",{"title":209,"path":210,"stem":211,"description":1047,"children":-1},"Solutions to frequently encountered problems when using serversideup/php Docker images.",1789148867618]