Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
jb-vpn.uk Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Webapp:Deployment
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Deployment Steps == === 1. Go to the app directory === <pre class="lang-bash"> cd /root/WebApp </pre> === 2. Pull latest code === <pre class="lang-bash"> git pull </pre> Resolve any merge conflicts before continuing. === 3. Rebuild Docker images (only when needed) === Rebuild '''only''' if you changed: * <code>docker/Dockerfile</code> * <code>docker-compose.yml</code> (service build context, Dockerfile path, or image name) * Base PHP/extensions or system packages <pre class="lang-bash"> docker compose build --no-cache app docker compose up -d </pre> If you did '''not''' change the above, skip this step and keep the stack running. === 4. Install or update PHP dependencies === <pre class="lang-bash"> docker compose exec -T -u root app composer install --no-interaction docker compose exec -T -u root app chown -R www:www /var/www/vendor /var/www/bootstrap/cache </pre> For major upgrades (e.g. Laravel version bump) you may use <code>composer update</code> instead of <code>composer install</code> after reviewing dependencies. === 5. Run database migrations === <pre class="lang-bash"> docker compose exec -T app php artisan migrate --force </pre> Use <code>--force</code> in production so the command does not prompt. === 6. Build frontend assets (Vite) === Required after any change to JS, CSS, or Vite config so <code>public/build/</code> is up to date: <pre class="lang-bash"> docker run --rm -v "$(pwd):/app" -w /app node:20-bookworm-slim sh -c "npm ci && npm run build" </pre> Alternatively, build inside the app container and fix ownership: <pre class="lang-bash"> docker compose exec -u root app sh -c "npm ci && npm run build && chown -R www:www /var/www/node_modules /var/www/public/build" </pre> === 7. Clear application caches === <pre class="lang-bash"> docker compose exec -T app php artisan config:clear docker compose exec -T app php artisan cache:clear docker compose exec -T app php artisan view:clear </pre> Optional after config changes: <code>php artisan config:cache</code>. === 8. Restart app (and optionally Nginx) === If you only changed code or env (no image rebuild): <pre class="lang-bash"> docker compose restart app </pre> If you changed Nginx config (<code>docker/nginx/conf.d/app.conf</code>): <pre class="lang-bash"> docker compose restart nginx </pre> For a full stack restart: <pre class="lang-bash"> docker compose up -d </pre>
Summary:
Please note that all contributions to jb-vpn.uk Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Jb-vpn.uk Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Webapp:Deployment
(section)
Add topic