-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel + Docker guide #21276
base: main
Are you sure you want to change the base?
Laravel + Docker guide #21276
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @rw4lll
Is this PR ready for review yet? 🔍
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
I hope so 😄 . I've tried to add tags, but it seems that if add a new tag, its not recognized: tags: [frameworks]
languages: [php] This will return error like:
But if I use any other tag which already exists, it works well. Where can I register new "frameworks" tag or should I use one existing? |
@dvdksn added tag support |
layouts/partials/sidebar/guides.html
Outdated
@@ -35,7 +35,7 @@ | |||
<p>Resources:</p> | |||
<ul class="ml-4 space-y-2"> | |||
{{- range . }} | |||
<li><a href="{{ .url }}" class="link">{{ .title }}</a></li> | |||
<li><a href="{{ .url }}" {{- if .external }} target="_blank" {{- end }} class="link">{{ .title }}</a></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this and the corresponding front matter property; last week I'd said LGTM but I was recently made aware that target=_blank is a bad pattern. See this issue:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, fixed
# Install NVM (Node Version Manager) as the www user | ||
RUN export NVM_DIR="$HOME/.nvm" && \ | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash && \ | ||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ | ||
nvm install ${NODE_VERSION} && \ | ||
nvm alias default ${NODE_VERSION} && \ | ||
nvm use default | ||
|
||
# Ensure NVM is available for all future shells | ||
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /home/www/.bashrc && \ | ||
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /home/www/.bashrc && \ | ||
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /home/www/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why you're using NVM here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dvdksn sure, the idea is to use this container as a workspace for laravel local development. It should include at least php cli for running artisan commands and node for assets building. Nvm here helps to switch between node versions easily through the env param.
UID: ${UID} | ||
GID: ${GID} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If GID
and UID
env vars are unset, this would set UID
and GID
to empty strings, and thereby override the default 1000
set in the Dockerfile
- "${POSTGRES_PORT}:5432" | ||
environment: | ||
- POSTGRES_DB=${POSTGRES_DATABASE} | ||
- POSTGRES_USER=${POSTGRES_USERNAME} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This compose file has a lot of dependencies to environment variables. I think it's better to try and keep non-secret values in the compose file directly. Still, the .env
will need some explanation.
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Description
Introduces new section /frameworks and adds first guide for Laravel PHP framework based on Docker Compose with examples for development and production environments.
Additionally (a topic to discuss) introduces boolean flag "external" for sidebar links to improve the user experience, when dealing with external links to open them in a new tab.
Related issues or tickets
Reviews