Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac03fea565 | |||
| eca9f58ded | |||
| 2c4ba8701d | |||
| 9052ef6ccd | |||
| c30aa78354 | |||
| f9bbc871ae | |||
| 11a2559fd7 | |||
| 3a232eeb9e | |||
| fb225cfeaf | |||
| 19a72aa415 | |||
| c50ef69480 | |||
| 5982495722 | |||
|
|
dcc02b3e88 | ||
| 34e14034c3 | |||
| e0ee5eb9a8 | |||
| 95d84f8660 | |||
| 58bda2df32 | |||
| 29c690d454 | |||
| fe18131363 | |||
| 7c64072192 | |||
| 26f65e7f15 | |||
| 309d7d148e | |||
| 21adddf19a | |||
|
|
b3c1952e9d | ||
| 129af47626 | |||
| e5a0cde614 | |||
| a35ae28a21 | |||
| fef9baec62 | |||
| 5870025017 | |||
| 1ca34319c8 | |||
| aaf97839f8 | |||
| 3c8b1f42c5 | |||
| f49d94041f | |||
| ff8d6f4390 | |||
| 81a41040bb | |||
| 05c1afb8e5 | |||
| 8649b86743 | |||
| ac363dccb7 | |||
| 14df49cd45 | |||
| 6c17d233d8 | |||
| 48160fd97d |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "build/submodules/artisan-bash-completion"]
|
||||||
|
path = build/submodules/artisan-bash-completion
|
||||||
|
url = https://gitlab.com/balping/artisan-bash-completion.git
|
||||||
@@ -1,7 +1,22 @@
|
|||||||
when:
|
when:
|
||||||
branch: dev
|
branch: dev
|
||||||
|
|
||||||
pipeline:
|
steps:
|
||||||
|
update_submodule:
|
||||||
|
image: woodpeckerci/plugin-git
|
||||||
|
secrets:
|
||||||
|
- source: gitea_token
|
||||||
|
target: GITEA_TOKEN
|
||||||
|
- source: gitea_user
|
||||||
|
target: GITEA_USER
|
||||||
|
commands:
|
||||||
|
- git submodule update --remote
|
||||||
|
- if [ ! "$(git status --porcelain)" ]; then echo "no changes"; exit 0; fi
|
||||||
|
- git config user.name "$${GITEA_USER}"
|
||||||
|
- git config user.email "$${GITEA_USER}.gitea@narvas.tech"
|
||||||
|
- git add -A
|
||||||
|
- git commit -m "update submodules [skip ci]"
|
||||||
|
- git push "https://$${GITEA_USER}:$${GITEA_TOKEN}@git.narvas.tech/$${CI_REPO}"
|
||||||
check_base:
|
check_base:
|
||||||
image: vistanarvas/container-update-checker:latest
|
image: vistanarvas/container-update-checker:latest
|
||||||
secrets:
|
secrets:
|
||||||
@@ -27,4 +42,4 @@ pipeline:
|
|||||||
path:
|
path:
|
||||||
include: [ '.woodpecker/build-dev.yaml', 'build/*', 'Dockerfile' ]
|
include: [ '.woodpecker/build-dev.yaml', 'build/*', 'Dockerfile' ]
|
||||||
cron: nightly
|
cron: nightly
|
||||||
event: [push, cron, manual]
|
event: [push, cron, manual]
|
||||||
@@ -1,7 +1,25 @@
|
|||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
|
|
||||||
pipeline:
|
steps:
|
||||||
|
update_submodule:
|
||||||
|
image: woodpeckerci/plugin-git
|
||||||
|
secrets:
|
||||||
|
- source: gitea_token
|
||||||
|
target: GITEA_TOKEN
|
||||||
|
- source: gitea_user
|
||||||
|
target: GITEA_USER
|
||||||
|
commands:
|
||||||
|
- git submodule update --remote
|
||||||
|
- if [ ! "$(git status --porcelain)" ]; then echo "no changes"; exit 0; fi
|
||||||
|
- git config user.name "$${GITEA_USER}"
|
||||||
|
- git config user.email "$${GITEA_USER}.gitea@narvas.tech"
|
||||||
|
- git add -A
|
||||||
|
- git commit -m "update submodules [skip ci]"
|
||||||
|
- git push "https://$${GITEA_USER}:$${GITEA_TOKEN}@git.narvas.tech/$${CI_REPO}"
|
||||||
|
when:
|
||||||
|
cron: nightly
|
||||||
|
event: [push, tag, deployment, cron, manual]
|
||||||
check_base:
|
check_base:
|
||||||
image: vistanarvas/container-update-checker:latest
|
image: vistanarvas/container-update-checker:latest
|
||||||
secrets:
|
secrets:
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ ARG COMPOSER_VERSION='' # composer version number like "2.1" or empty for the la
|
|||||||
ENV NVM_DIR="/home/$USERNAME/.nvm"
|
ENV NVM_DIR="/home/$USERNAME/.nvm"
|
||||||
|
|
||||||
COPY start-container.sh /usr/local/bin/start-container
|
COPY start-container.sh /usr/local/bin/start-container
|
||||||
|
COPY submodules/artisan-bash-completion/artisan /etc/bash_completion.d/artisan
|
||||||
|
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get -y update \
|
&& apt-get -y update \
|
||||||
&& apt-get install -y curl git 7zip php php-xml php-curl php-xml php-mbstring php-mysql \
|
&& apt-get install -y curl git 7zip php php-xml php-curl php-xml php-mbstring php-mysql php-gd \
|
||||||
&& useradd --create-home --uid=$USER_UID $USERNAME \
|
&& useradd --create-home --uid=$USER_UID $USERNAME \
|
||||||
&& chmod +x /usr/local/bin/start-container \
|
&& chmod +x /usr/local/bin/start-container \
|
||||||
&& echo "install composer" \
|
&& echo "install composer" \
|
||||||
@@ -22,7 +23,9 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
|||||||
&& if [ -n "$COMPOSER_VERSION" ]; then COMPOSER_VERSION="--${COMPOSER_VERSION}"; fi \
|
&& if [ -n "$COMPOSER_VERSION" ]; then COMPOSER_VERSION="--${COMPOSER_VERSION}"; fi \
|
||||||
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer $COMPOSER_VERSION \
|
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer $COMPOSER_VERSION \
|
||||||
&& rm composer-setup.php composer-setup.sig /var/www/html/* \
|
&& rm composer-setup.php composer-setup.sig /var/www/html/* \
|
||||||
&& chown $USERNAME:$USERNAME /var/www/html
|
&& chown $USERNAME:$USERNAME /var/www/html \
|
||||||
|
&& echo 'alias artisan="php artisan"' >> /etc/bash.bashrc \
|
||||||
|
&& echo 'source /etc/bash_completion.d/*' >> /etc/bash.bashrc
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
|
|||||||
36
Readme.md
Normal file
36
Readme.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# simple-laravel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## setting laravel up in a container
|
||||||
|
|
||||||
|
### vite
|
||||||
|
edit `/vite.config.js`
|
||||||
|
```diff
|
||||||
|
import laravel from 'laravel-vite-plugin';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
+ server: {
|
||||||
|
+ hmr: {
|
||||||
|
+ host: '[Server Domain or IP]'
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
plugins: [
|
||||||
|
laravel({
|
||||||
|
input: [
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
edit `/package.json`
|
||||||
|
|
||||||
|
```diff
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
- "dev": "vite",
|
||||||
|
+ "dev": "vite --host 0.0.0.0",
|
||||||
|
"build": "vite build"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
|
||||||
|
```
|
||||||
@@ -6,14 +6,16 @@ set -e
|
|||||||
# init nvm
|
# init nvm
|
||||||
\. $NVM_DIR/nvm.sh
|
\. $NVM_DIR/nvm.sh
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$INSTALL_BEFORE_START" = true ]]; then
|
||||||
|
echo "composer and npm install"
|
||||||
|
composer install
|
||||||
|
npm install
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f /var/www/html/artisan ]; then
|
if [ ! -f /var/www/html/artisan ]; then
|
||||||
echo "No existing Laravel project found"
|
echo "No existing Laravel project found"
|
||||||
composer create-project laravel/laravel /var/www/html "$LARAVEL_VERSION"
|
exit
|
||||||
npm install -D tailwindcss postcss autoprefixer --prefix /var/www/html
|
|
||||||
sed -i "/export default defineConfig({/a\ server: {host: '0.0.0.0'}," /var/www/html/vite.config.js
|
|
||||||
echo -e "@tailwind base;\n@tailwind components;\n@tailwind utilities;" >> /var/www/html/resources/css/app.css
|
|
||||||
echo -e '/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n content: [\n "./resources/**/*.blade.php",\n "./resources/**/*.js",\n "./resources/**/*.vue",\n ],\n theme: {\n extend: {},\n },\n plugins: [],\n}' > /var/www/html/tailwind.config.js
|
|
||||||
npx tailwindcss init -p
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$AUTO_START_NPM_DEV" = true ]]; then
|
if [[ "$AUTO_START_NPM_DEV" = true ]]; then
|
||||||
@@ -22,4 +24,4 @@ if [[ "$AUTO_START_NPM_DEV" = true ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Staring Laravel"
|
echo "Staring Laravel"
|
||||||
php /var/www/html/artisan serve --host=0.0.0.0 --port=8080
|
php /var/www/html/artisan serve
|
||||||
|
|||||||
1
build/submodules/artisan-bash-completion
Submodule
1
build/submodules/artisan-bash-completion
Submodule
Submodule build/submodules/artisan-bash-completion added at 8f6dd7d473
Reference in New Issue
Block a user