Skip to content

Commit

Permalink
add dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Apr 12, 2023
1 parent 514976e commit 928ca44
Show file tree
Hide file tree
Showing 17 changed files with 162 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ yarn-error.log
/.vscode
/.npm
/.bash_history
/_volumes/*
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
47 changes: 46 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions docker-compose.dev.yaml

This file was deleted.

59 changes: 59 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -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



5 changes: 0 additions & 5 deletions docker-compose.prod.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions docker-compose.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions docker/dev-ssu/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 2 additions & 0 deletions docker/dev-ssu/etc/s6-overlay/s6-rc.d/queue-worker/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/command/execlineb -P
su - webuser -c "php /var/www/html/artisan queue:listen --timeout=600 --rest=1 --memory=512"
1 change: 1 addition & 0 deletions docker/dev-ssu/etc/s6-overlay/s6-rc.d/queue-worker/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.
8 changes: 8 additions & 0 deletions docker/prod-ssu/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 2 additions & 0 deletions docker/prod-ssu/s6-rc.d/queue-worker/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/command/execlineb -P
su - webuser -c "php /var/www/html/artisan queue:listen"
1 change: 1 addition & 0 deletions docker/prod-ssu/s6-rc.d/queue-worker/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.

0 comments on commit 928ca44

Please sign in to comment.