Skip to content

Commit

Permalink
fix(docker-pack): .spells: add to manifest, allow killing long Docker…
Browse files Browse the repository at this point in the history
… processes (#49)

* fix(docker-pack): .spells: add to manifest, allow killing long Docker processes

Needed for some processes like Symfony Messenger consume for example.

* Update faros-ng/docker-pack/2.3/.env.dev

Co-authored-by: Thibaut Selingue <[email protected]>

---------

Co-authored-by: Thibaut Selingue <[email protected]>
  • Loading branch information
lucasmirloup and thislg authored Oct 15, 2024
1 parent ea91c3a commit 8a476b0
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 2 deletions.
3 changes: 3 additions & 0 deletions faros-ng/docker-pack/2.3/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SENTRY_DSN=
MAILER_DSN=smtp://maildev:25
DATABASE_URL="postgres://postgres:root@pgsql_16:5432/project?serverVersion=16&charset=utf8"
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ _docker_exec()
_docker_run()
{
if [ "$(uname -s)" != "Darwin" ]; then
docker run --rm -it -u "$(id -u):$(id -g)" "$@"
docker run --init --rm -it -u "$(id -u):$(id -g)" "$@"
else
docker run --rm -it "$@"
docker run --init --rm -it "$@"
fi
}

Expand Down
35 changes: 35 additions & 0 deletions faros-ng/docker-pack/2.3/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
php:
image: lephare/php:8.3
volumes:
- ./:/var/www/symfony
- ${COMPOSER_HOME:-~/.composer}:/tmp/composer
environment:
COMPOSER_HOME: /tmp/composer
DOCKER_HOST_SUFFIX: ${DOCKER_HOST_SUFFIX:-local}
SYMFONY_DEPRECATIONS_HELPER: "max[direct]=0&verbose=1"
networks:
- default
- private

web:
image: lephare/apache:2.4
networks:
- default
- public
volumes_from:
- php:ro
labels:
caddy: 'project.${DOCKER_HOST_SUFFIX:-local}'
caddy.tls: internal
caddy.reverse_proxy: '{{ upstreams }}'
environment:
DOCUMENT_ROOT: /var/www/symfony/public

networks:
private:
external: true
name: dev_private
public:
external: true
name: dev_public
11 changes: 11 additions & 0 deletions faros-ng/docker-pack/2.3/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"copy-from-recipe": {
".env.dev": ".env.dev",
".spells": ".spells",
"docker-compose.yml": "docker-compose.yml",
"public/": "%PUBLIC_DIR%/"
},
"gitignore": [
"docker-compose.override.yml"
]
}
11 changes: 11 additions & 0 deletions faros-ng/docker-pack/2.3/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> Docker configuration </>
<bg=blue;fg=white> </>

* <fg=blue>Update</> the <comment>VIRTUAL_HOST</> environment variable in the file <comment>docker-compose.yml</>

* <fg=blue>Update</> the database name in the file <comment>.env.dev</>

* <fg=blue>Run</> your application:
1. Change to the project directory
2. Execute the <comment>docker-compose up -d</> command
74 changes: 74 additions & 0 deletions faros-ng/docker-pack/2.3/public/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 10 years"
ExpiresByType image/jpeg "access plus 10 years"
ExpiresByType image/png "access plus 10 years"
ExpiresByType text/css "access plus 10 years"
ExpiresByType text/javascript "access plus 10 years"
ExpiresByType application/javascript "access plus 10 years"
ExpiresByType application/x-unknown-content-type "access plus 10 years"
ExpiresByType application/x-javascript "access plus 10 years"
ExpiresByType application/x-font-woff "access plus 10 years"
</IfModule>

<filesMatch ".(svg|woff2|woff)$">
ExpiresDefault "access plus 10 years"
FileETag None
</filesMatch>

<filesMatch ".(js|css)$">
FileETag None
</filesMatch>

<filesMatch "^(favicon|apple-touch-icon|android-chrome|mstile)">
FileETag None
</filesMatch>

# ----------------------------------------------------------------------
# Allow loading of external fonts
# ----------------------------------------------------------------------
<FilesMatch "\.(ttf|otf|eot|woff|woff2)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

# Security Headers
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Referrer-Policy "strict-origin-when-cross-origin"

# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
Options FollowSymlinks

# Authorization settings


<IfModule mod_rewrite.c>
RewriteEngine On

# Sets the HTTP_AUTHORIZATION header removed by Apache
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(?:/(.*)|$) /$1 [R=301,L]

# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# Rewrite all other queries to the front controller.
RewriteRule ^ /index.php [L]
</IfModule>

0 comments on commit 8a476b0

Please sign in to comment.