Remove unnecessary configuration and prepare for more containers

This commit is contained in:
2020-11-21 14:50:27 +00:00
parent ac83101e53
commit 44263c250f
3 changed files with 14 additions and 16 deletions

View File

@@ -1,12 +1,12 @@
version: "3.4" version: "3.4"
services: services:
app: monica:
build: ./monica build: ./monica
image: monica image: monica
env_file: ./monica/.env env_file: ./monica/.env
volumes: volumes:
- data:/var/www/html/storage - monica-data:/var/www/html/storage
- monica-public:/var/www/html/public - monica-public:/var/www/html/public
restart: always restart: always
depends_on: depends_on:
@@ -27,18 +27,15 @@ services:
image: nginx:alpine image: nginx:alpine
restart: always restart: always
volumes: volumes:
- data:/var/www/html/storage:ro
- certs:/etc/nginx/certs:ro - certs:/etc/nginx/certs:ro
- ./nginx.conf:/etc/nginx/nginx.conf - ./nginx.conf:/etc/nginx/nginx.conf
- monica-public:/var/www/html/public:ro - monica-public:/var/www/html/monica/public:ro
- monica-data:/var/www/html/monica/storage:ro
depends_on: depends_on:
- app - monica
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
networks:
- proxy-tier
- default
depends_on: depends_on:
- omgwtfssl - omgwtfssl
@@ -53,14 +50,10 @@ services:
- SSL_KEY=/certs/personel.scarif.local.key - SSL_KEY=/certs/personel.scarif.local.key
- SSL_CSR=/certs/personel.scarif.local.csr - SSL_CSR=/certs/personel.scarif.local.csr
- SSL_CERT=/certs/personel.scarif.local.crt - SSL_CERT=/certs/personel.scarif.local.crt
networks:
- proxy-tier
volumes: volumes:
data:
db: db:
certs: certs:
monica-public: monica-public:
monica-data:
networks:
proxy-tier:

View File

@@ -50,6 +50,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# Run migrations # Run migrations
waitfordb waitfordb
${ARTISAN} monica:update --force -vv ${ARTISAN} monica:update --force -vv
# Override the linking done by monica:update to use relative paths so the nginx directory can be anywhere
unlink ${MONICADIR}/public/storage
ln -s ../storage/app/public /var/www/html/public/storage
if [ -n "${SENTRY_SUPPORT:-}" -a "$SENTRY_SUPPORT" = "true" -a -z "${SENTRY_NORELEASE:-}" -a -n "${SENTRY_ENV:-}" ]; then if [ -n "${SENTRY_SUPPORT:-}" -a "$SENTRY_SUPPORT" = "true" -a -z "${SENTRY_NORELEASE:-}" -a -n "${SENTRY_ENV:-}" ]; then
commit=$(cat .sentry-commit) commit=$(cat .sentry-commit)

View File

@@ -29,7 +29,7 @@ http {
# Connect to app service # Connect to app service
upstream php-handler { upstream php-handler {
server app:9000; server monica:9000;
} }
server { server {
@@ -59,7 +59,7 @@ http {
# Remove X-Powered-By, which is an information leak # Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By; fastcgi_hide_header X-Powered-By;
root /var/www/html/public; root /var/www/html/monica/public;
index index.html index.htm index.php; index index.html index.htm index.php;
@@ -115,7 +115,9 @@ http {
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Cannot use $document_root as the path to monica on the docker container
# is different to the path to the public files in this nginx container.
fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
# Bypass the fact that try_files resets $fastcgi_path_info # Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321 # see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info; set $path_info $fastcgi_path_info;