add dev environment

This commit is contained in:
Andras Bacsai 2023-04-12 21:23:32 +02:00
parent 514976e9e5
commit 928ca44f7d
17 changed files with 162 additions and 17 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ yarn-error.log
/.vscode
/.npm
/.bash_history
/_volumes/*

View File

@ -27,6 +27,7 @@
"nunomaduro/collision": "^7.0",
"pestphp/pest": "^2.0",
"phpunit/phpunit": "^10.0",
"serversideup/spin": "^1.1",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {

47
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f6c39647206d4c1157c2be1d960de5cc",
"content-hash": "0d98b364229f1e4fe5fff9434f69b49e",
"packages": [
{
"name": "bacon/bacon-qr-code",
@ -9753,6 +9753,51 @@
],
"time": "2023-02-07T11:34:05+00:00"
},
{
"name": "serversideup/spin",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/serversideup/spin.git",
"reference": "03bb69dbdc6d6a68b82b4bb4cfeb7accc4f8758f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/serversideup/spin/zipball/03bb69dbdc6d6a68b82b4bb4cfeb7accc4f8758f",
"reference": "03bb69dbdc6d6a68b82b4bb4cfeb7accc4f8758f",
"shasum": ""
},
"bin": [
"bin/spin"
],
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0-or-later"
],
"authors": [
{
"name": "Dan Pastori",
"homepage": "https://twitter.com/danpastori"
},
{
"name": "Jay Rogers",
"homepage": "https://twitter.com/jaydrogers"
}
],
"description": "Replicate your production environment locally using Docker. Just run \"spin up\". It's really that easy.",
"support": {
"issues": "https://github.com/serversideup/spin/issues",
"source": "https://github.com/serversideup/spin/tree/v1.1.0"
},
"funding": [
{
"url": "https://github.com/serversideup",
"type": "github"
}
],
"time": "2022-05-20T15:13:10+00:00"
},
{
"name": "spatie/flare-client-php",
"version": "1.3.5",

View File

@ -1,5 +0,0 @@
version: '3.8'
services:
coolify:
environment:
- PRODUCTION="false"

59
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,59 @@
version: '3.8'
x-testing-host: &testing-host-base
image: coolify-testing-host
build:
dockerfile: Dockerfile
context: ./docker/testing-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/testing-host/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
networks:
- coolify
services:
coolify:
build:
context: .
dockerfile: ./docker/dev-ssu/Dockerfile
ports:
- "${APP_PORT:-8000}:80"
- "${VITE_PORT:-5173}:${VITE_PORT:-5173}"
environment:
PUID: "${USERID:-1000}"
PGID: "${GROUPID:-1000}"
SSL_MODE: "off"
AUTORUN_LARAVEL_STORAGE_LINK: "false"
AUTORUN_LARAVEL_MIGRATION: "false"
env_file:
- .env
volumes:
- .:/var/www/html/:cached
postgres:
ports:
- "${FORWARD_DB_PORT:-5432}:5432"
env_file:
- .env
environment:
POSTGRES_USER: "${DB_USERNAME}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_DATABASE}"
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- ./_volumes/database/:/var/lib/postgresql/data
vite:
image: node:19
working_dir: /var/www/html
volumes:
- .:/var/www/html:cached
command: sh -c "npm install && npm run dev"
testing-host:
<<: *testing-host-base
container_name: coolify-testing-host
testing-host2:
<<: *testing-host-base
container_name: coolify-testing-host-2

View File

@ -1,5 +0,0 @@
version: '3.8'
services:
coolify:
environment:
- PRODUCTION="true"

18
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,18 @@
version: '3.8'
services:
coolify:
build:
context: .
dockerfile: ./docker/prod-ssu/Dockerfile
environment:
AUTORUN_LARAVEL_STORAGE_LINK: "true"
AUTORUN_LARAVEL_MIGRATION: "true"
env_file:
- .env
postgres:
environment:
POSTGRES_USER: "${DB_USERNAME}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_DATABASE}"
env_file:
- .env

View File

@ -1,6 +0,0 @@
version: '3.8'
services:
coolify:
image: serversideup/php:8.2-fpm-nginx
postgres:
image: postgres:15-alpine

15
docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: '3.8'
services:
coolify:
working_dir: /var/www/html
networks:
- coolify
depends_on:
- postgres
postgres:
image: postgres:15-alpine
networks:
- coolify
networks:
coolify:
driver: bridge

View File

@ -0,0 +1,8 @@
FROM serversideup/php:8.2-fpm-nginx
ARG POSTGRES_VERSION=15
RUN apt-get update && apt-get install -y php-pgsql openssh-client
RUN apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
COPY --chmod=755 docker/dev-ssu/etc/s6-overlay/ /etc/s6-overlay/

View File

@ -0,0 +1,2 @@
#!/command/execlineb -P
su - webuser -c "php /var/www/html/artisan queue:listen --timeout=600 --rest=1 --memory=512"

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,8 @@
FROM serversideup/php:8.2-fpm-nginx
ARG POSTGRES_VERSION=15
RUN apt-get update && apt-get install -y php-pgsql openssh-client
RUN apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
COPY --chmod=755 docker/dev-ssu/etc/s6-overlay/ /etc/s6-overlay/

View File

@ -0,0 +1,2 @@
#!/command/execlineb -P
su - webuser -c "php /var/www/html/artisan queue:listen"

View File

@ -0,0 +1 @@
longrun