From 9037f8825f3eba95ea2fa6fc5e14efc876f85498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Sun, 10 Dec 2023 13:19:03 +0100 Subject: [PATCH] wip --- .dockerignore | 26 -------------------------- Makefile | 4 ++-- docker-compose.yml | 10 ++++++---- nginx/nginx.conf | 35 ++++++++++++++++++----------------- 4 files changed, 26 insertions(+), 49 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 7f29df3..0000000 --- a/.dockerignore +++ /dev/null @@ -1,26 +0,0 @@ -_build -CONTRIBUTING.md -coverage -demo -deps -doc -docs -docker-compose.yml -Dockerfile -.elixir_ls -.formatter.exs -.git -.gitignore -.gitlab -.gitlab-ci.yml -.graphqlconfig.yaml -LICENSE -Makefile -README.md -SECURITY.md -ssh_match_hostname -package-lock.json -node_modules -playwright-report -test -tests diff --git a/Makefile b/Makefile index 639368a..42df373 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ init: setup: stop @bash mobilizon/mobilizon/docker/message.sh "Compiling everything" - docker-compose run --rm -e HEX_UNSAFE_HTTPS=1 mobilizon bash -c 'mix hex.config unsafe_https true; mix deps.get; npm ci; npm run build:pictures; mix ecto.create; mix ecto.migrate' + docker-compose run --rm mobilizon bash -c 'mix deps.get; npm ci; npm run build:pictures; mix ecto.create; mix ecto.migrate' migrate: - docker-compose run --rm -e HEX_UNSAFE_HTTPS=1 mobilizon mix ecto.migrate + docker-compose run --rm mobilizon mix ecto.migrate logs: docker-compose logs -f start: stop diff --git a/docker-compose.yml b/docker-compose.yml index 433a1a7..dc5225b 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,8 @@ services: - POSTGRES_PORT=5432 volumes: - mobilizon_database_data:/var/lib/postgresql/data + ports: + - "5432:5432" mobilizon: container_name: mobilizon @@ -42,6 +44,7 @@ services: - "./mobilizon/dev.exs:/app/config/dev.exs" - "./certs/lan-key.pem:/app/priv/server.key:ro" - "./certs/lan.pem:/app/priv/server.pem:ro" + - "/etc/ssl/certs/ca-certificates.crt:/app/priv/ca-bundle.crt:ro" depends_on: - postgres environment: @@ -58,9 +61,8 @@ services: MOBILIZON_DATABASE_DBNAME: mobilizon MOBILIZON_DATABASE_HOST: postgres MOBILIZON_DATABASE_PORT: 5432 - HEX_UNSAFE_HTTPS: 1 VITE_HOST: 0.0.0.0 - command: sh -c "HEX_UNSAFE_HTTPS=1 mix phx.server" + command: sh -c "mix phx.server" expose: - "443" - "4000" @@ -73,8 +75,8 @@ services: dockerfile: Dockerfile volumes: - ./wordpress/wordpress:/var/www/html - - /etc/ssl/certs:/etc/ssl/certs:ro - - /etc/ca-certificates/:/etc/ca-certificates/:ro + - /etc/ssl/certs/ca-certificates.crt:/var/www/html/wp-includes/certificates/ca-bundle.crt:ro + environment: - DOCKER_DEV_DOMAIN=wp.lan - WORDPRESS_DB_NAME=wordpress diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 0e5364a..40e1346 100755 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -8,6 +8,7 @@ http { server_name wp.lan; listen 80; + # return 301 https://$server_name$request_uri; index index.php; location / { @@ -18,29 +19,29 @@ http { } } - server { - server_name wp.lan; - listen 443 ssl; - http2 on; + # server { + # server_name wp.lan; + # listen 443 ssl; + # http2 on; - ssl_certificate /etc/nginx/certs/lan.pem; - ssl_certificate_key /etc/nginx/certs/lan-key.pem; + # ssl_certificate /etc/nginx/certs/lan.pem; + # ssl_certificate_key /etc/nginx/certs/lan-key.pem; - index index.php; + # index index.php; - location / { - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass "http://wordpress"; - } - } + # location / { + # proxy_set_header X-Forwarded-For $remote_addr; + # proxy_set_header Host $http_host; + # proxy_set_header X-Forwarded-Proto $scheme; + # proxy_pass "http://wordpress"; + # } + # } server { - server_name mz.lan; - listen 80; + server_name mz.lan; + listen 80; - return 301 https://$server_name$request_uri; + return 301 https://$server_name$request_uri; } server {