diff --git a/Makefile b/Makefile index b7ee459..77c1772 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,7 @@ init: setup: stop @bash mobilizon/docker/message.sh "Compiling everything" - # docker-compose run --rm mobilizon bash -c 'mix hex.config unsafe_https true; mix deps.get; npm ci; npm run build:pictures' - docker-compose run --rm mobilizon bash -c 'mix ecto.create; mix ecto.migrate' + 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' migrate: docker-compose run --rm mobilizon mix ecto.migrate logs: diff --git a/docker-compose.yml b/docker-compose.yml index 3d02939..292ff76 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,12 +37,13 @@ services: build: context: ./mobilizon dockerfile: Dockerfile + args: + - HEX_UNSAFE_HTTPS=1 volumes: - "./mobilizon:/app" - "~/.local/share/mkcert/:/root/.local/share/mkcert/:ro" - ports: - - 4000:4000 - - 5173:5173 + - /etc/ssl/certs:/etc/ssl/certs:ro + - /etc/ca-certificates/:/etc/ca-certificates/:ro depends_on: - postgres environment: @@ -59,10 +60,16 @@ services: MOBILIZON_DATABASE_DBNAME: mobilizon MOBILIZON_DATABASE_HOST: postgres MOBILIZON_DATABASE_PORT: 5432 - VITE_HOST: ${VITE_HOST:-0.0.0.0} - command: sh -c "mix hex.config unsafe_https true; mix phx.server" + HEX_UNSAFE_HTTPS: 1 + HEX_CACERTS_PATH: /etc/ssl/certs + VITE_HOST: 0.0.0.0 + command: sh -c "HEX_UNSAFE_HTTPS=1 mix phx.server" + ports: + - "4000:4000" + - "5173:5173" expose: - "4000" + - "5173" wordpress: build: diff --git a/nginx.conf b/nginx.conf index 6b21760..b26a20c 100755 --- a/nginx.conf +++ b/nginx.conf @@ -7,7 +7,14 @@ http { server { listen 80; server_name wp.lan; - return 301 https:/$host$request_uri; + 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"; + } } server {