Skip to content

Commit b80a681

Browse files
authored
Merge pull request #9 from connorabbas/develop
fix typo, pull in docker related files
2 parents ebd20f8 + 49910ab commit b80a681

File tree

9 files changed

+247
-4
lines changed

9 files changed

+247
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// https://aka.ms/devcontainer.json
2+
{
3+
"name": "PrimeVue Inertia",
4+
"dockerComposeFile": [
5+
"../docker-compose.yml"
6+
],
7+
"service": "primevue_intertia",
8+
"workspaceFolder": "/var/www/html",
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"absszero.vscode-laravel-goto",
13+
"amiralizadeh9480.laravel-extra-intellisense",
14+
"bmewburn.vscode-intelephense-client",
15+
"codingyu.laravel-goto-view",
16+
"eamodio.gitlens",
17+
"esbenp.prettier-vscode",
18+
"mikestead.dotenv",
19+
"recca0120.vscode-phpunit",
20+
"streetsidesoftware.code-spell-checker",
21+
"MehediDracula.php-namespace-resolver",
22+
"onecentlin.laravel-blade",
23+
"hollowtree.vue-snippets",
24+
"Vue.volar",
25+
"shd101wyy.markdown-preview-enhanced"
26+
],
27+
"settings": {}
28+
}
29+
},
30+
"remoteUser": "sail",
31+
"postCreateCommand": "chown -R 1000:1000 /var/www/html 2>/dev/null || true"
32+
// "forwardPorts": [],
33+
// "runServices": [],
34+
// "shutdownAction": "none",
35+
}

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
Homestead.json
1515
Homestead.yaml
1616
auth.json
17-
docker-compose.yml
1817
npm-debug.log
1918
yarn-error.log
2019
/.fleet
2120
/.idea
22-
/.vscode
23-
/.devcontainer
21+
/.vscode

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This starter kit provides a light/dark mode and custom theme functionality provi
5353

5454
The starting point for customizing your theme will be the `resources/js/theme-preset.js` module file. To quickly change the look and feel of your theme, swap the [primary](https://primevue.org/theming/styled/#primary) values with a different set of [colors](https://primevue.org/theming/styled/#colors), change the [surface](https://primevue.org/theming/styled/#surface) `colorScheme` values (slate, gray, neutral, etc.), or completely change the [preset theme](https://primevue.org/theming/styled/#presets) (Aura used by default).
5555

56-
Please reference the [PrimeVue Styled Mode Docs](https://primevue.org/theming/styled/) to fully understand how this system work, and how to further customize your theme to make it your own.
56+
Please reference the [PrimeVue Styled Mode Docs](https://primevue.org/theming/styled/) to fully understand how this system works, and how to further customize your theme to make it your own.
5757

5858
## PrimeVue v4 w/ Tailwind CSS
5959
If you have used a previous version of this project using PrimeVue v3, you'll know that Tailwind was removed in favor of PrimeFlex. With v4 however, the PrimeTek team has officially suggested [Moving from PrimeFlex to Tailwind CSS](https://primevue.org/guides/primeflex/).

docker-compose.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: '3.8'
2+
3+
services:
4+
primevue_intertia: # make sure to set as APP_SERVICE value in .env
5+
build:
6+
context: ./docker/8.3
7+
dockerfile: Dockerfile
8+
args:
9+
WWWGROUP: '${WWWGROUP}'
10+
image: sail-8.3/app
11+
extra_hosts:
12+
- 'host.docker.internal:host-gateway'
13+
ports:
14+
- '${APP_PORT:-80}:80'
15+
environment:
16+
WWWUSER: '${WWWUSER}'
17+
LARAVEL_SAIL: 1
18+
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
19+
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
20+
IGNITION_LOCAL_SITES_PATH: '${PWD}'
21+
volumes:
22+
- '.:/var/www/html'
23+
labels:
24+
- "traefik.enable=true"
25+
- "traefik.http.routers.primevue_intertia.rule=Host(`primevue-breeze-inertia.localhost`)"
26+
- "traefik.http.services.primevue_intertia.loadbalancer.server.port=80"
27+
networks:
28+
- proxy
29+
- database
30+
31+
networks:
32+
proxy:
33+
name: traefik_network
34+
database:
35+
name: mariadb_network
36+
external: true

docker/8.3/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM ubuntu:22.04
2+
3+
LABEL maintainer="Taylor Otwell"
4+
5+
ARG WWWGROUP
6+
ARG NODE_VERSION=20
7+
ARG MYSQL_CLIENT="mysql-client"
8+
ARG POSTGRES_VERSION=15
9+
10+
WORKDIR /var/www/html
11+
12+
ENV DEBIAN_FRONTEND noninteractive
13+
ENV TZ=UTC
14+
ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80"
15+
ENV SUPERVISOR_PHP_USER="sail"
16+
17+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
18+
19+
RUN apt-get update \
20+
&& mkdir -p /etc/apt/keyrings \
21+
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch ffmpeg nano \
22+
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
23+
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
24+
&& apt-get update \
25+
&& apt-get install -y php8.3-cli php8.3-dev \
26+
php8.3-pgsql php8.3-sqlite3 php8.3-gd \
27+
php8.3-curl \
28+
php8.3-imap php8.3-mysql php8.3-mbstring \
29+
php8.3-xml php8.3-zip php8.3-bcmath php8.3-soap \
30+
php8.3-intl php8.3-readline \
31+
php8.3-ldap \
32+
php8.3-msgpack php8.3-igbinary php8.3-redis php8.3-swoole \
33+
php8.3-memcached php8.3-pcov php8.3-imagick php8.3-xdebug \
34+
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
35+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
36+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
37+
&& apt-get update \
38+
&& apt-get install -y nodejs \
39+
&& npm install -g npm \
40+
&& npm install -g pnpm \
41+
&& npm install -g bun \
42+
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
43+
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
44+
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
45+
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
46+
&& apt-get update \
47+
&& apt-get install -y yarn \
48+
&& apt-get install -y $MYSQL_CLIENT \
49+
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
50+
&& apt-get -y autoremove \
51+
&& apt-get clean \
52+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
53+
54+
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.3
55+
56+
RUN groupadd --force -g $WWWGROUP sail
57+
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
58+
59+
COPY start-container /usr/local/bin/start-container
60+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
61+
COPY php.ini /etc/php/8.3/cli/conf.d/99-sail.ini
62+
RUN chmod +x /usr/local/bin/start-container
63+
64+
EXPOSE 80/tcp
65+
66+
ENTRYPOINT ["start-container"]

docker/8.3/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Additional Containers for Local Development
2+
3+
## Traefik
4+
```yml
5+
version: '3.8'
6+
7+
# https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/
8+
services:
9+
traefik:
10+
image: traefik:v3.1
11+
command:
12+
- --log.level=INFO
13+
- --api.insecure=true
14+
- --providers.docker=true
15+
- --providers.docker.network=traefik_network
16+
- --providers.docker.exposedByDefault=false
17+
- --entrypoints.web.address=:80
18+
ports:
19+
- "80:80"
20+
- "8080:8080" # Traefik Dashboard http://localhost:8080/
21+
volumes:
22+
- "/var/run/docker.sock:/var/run/docker.sock"
23+
networks:
24+
- proxy
25+
26+
networks:
27+
proxy:
28+
name: traefik_network
29+
30+
```
31+
32+
## Shared Database (or configure with Sail)
33+
```yml
34+
services:
35+
mariadb:
36+
image: mariadb:11
37+
container_name: mariadb
38+
restart: always
39+
environment:
40+
MYSQL_ROOT_PASSWORD: 'root'
41+
MYSQL_ROOT_HOST: "%"
42+
MYSQL_DATABASE: 'docker_mariadb'
43+
MYSQL_USER: 'docker_mariadb'
44+
MYSQL_PASSWORD: 'password'
45+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
46+
volumes:
47+
- mariadb_data:/var/lib/mysql
48+
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
49+
ports:
50+
- "3307:3306"
51+
networks:
52+
- database
53+
54+
volumes:
55+
mariadb_data:
56+
driver: local
57+
58+
networks:
59+
database:
60+
name: mariadb_network
61+
external: true
62+
63+
```

docker/8.3/php.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[PHP]
2+
post_max_size = 100M
3+
upload_max_filesize = 100M
4+
variables_order = EGPCS
5+
pcov.directory = .

docker/8.3/start-container

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$SUPERVISOR_PHP_USER" != "root" ] && [ "$SUPERVISOR_PHP_USER" != "sail" ]; then
4+
echo "You should set SUPERVISOR_PHP_USER to either 'sail' or 'root'."
5+
exit 1
6+
fi
7+
8+
if [ ! -z "$WWWUSER" ]; then
9+
usermod -u $WWWUSER sail
10+
fi
11+
12+
if [ ! -d /.composer ]; then
13+
mkdir /.composer
14+
fi
15+
16+
chmod -R ugo+rw /.composer
17+
18+
if [ $# -gt 0 ]; then
19+
if [ "$SUPERVISOR_PHP_USER" = "root" ]; then
20+
exec "$@"
21+
else
22+
exec gosu $WWWUSER "$@"
23+
fi
24+
else
25+
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
26+
fi

docker/8.3/supervisord.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[supervisord]
2+
nodaemon=true
3+
user=root
4+
logfile=/var/log/supervisor/supervisord.log
5+
pidfile=/var/run/supervisord.pid
6+
7+
[program:php]
8+
command=%(ENV_SUPERVISOR_PHP_COMMAND)s
9+
user=%(ENV_SUPERVISOR_PHP_USER)s
10+
environment=LARAVEL_SAIL="1"
11+
stdout_logfile=/dev/stdout
12+
stdout_logfile_maxbytes=0
13+
stderr_logfile=/dev/stderr
14+
stderr_logfile_maxbytes=0

0 commit comments

Comments
 (0)