Endpoint not publicly available (Gluetun - Mullvad) reddit / selfhosted ---------------------------------------------------------------------- DerreckValentine · 2023-11-16 04:36 I am trying to set up a python app and publicly available but through a vpn, it works locally when run, if I go to [http://127.0.0.1:8008/](http://127.0.0.1:8008/) but I can't access it from the public ip that I get back. I'm sure I'm missing something obvious since this is my first crack at all this. Here is my setup: services: gluetun: image: qmcgaw/gluetun cap_add: - NET_ADMIN ports: - 8008:8008/tcp network_mode: bridge environment: - VPN_SERVICE_PROVIDER=mullvad - VPN_TYPE=openvpn - OPENVPN_USER=############# - SERVER_CITIES=Atlanta GA web: build: . volumes: - .:/code environment: FLASK_DEBUG: "true" network_mode: "service:gluetun" depends_on: gluetun: condition: service_healthy redis: image: "redis:alpine" DockerFile: # syntax=docker/dockerfile:1 FROM python:3.7-alpine WORKDIR /code ENV FLASK_APP=app.py ENV FLASK_RUN_HOST=0.0.0.0 RUN apk add --no-cache gcc musl-dev linux-headers COPY requirements.txt requirements.txt RUN pip install -r requirements.txt EXPOSE 8008 COPY . . CMD ["flask", "run", "-p 8008"] App: import requests from flask import Flask app = Flask(__name__) def getIP(): endpoint = 'https://ipinfo.io/json' response = requests.get(endpoint, verify = True) if response.status_code != 200: return 'Status:', response.status_code, 'Problem with the request. Exiting.' exit() data = response.json() return data['ip'] @app.route('/') def index(): return 'Your ip is ' + getIP() print("Initial Public IP:") print(getIP()) ​ ---------------------------------------------------------------------- lighty262 · 2023-11-16 05:07 I believe you have to add the port property in your docker compose service. ---------------------------------------------------------------------- ButCaptainThatsMYRum · 2023-11-16 05:08 Dude it sounds like you're skipping learning to walk and going straight to running. Take a week or two to ice this and learn networking and basic security. An easy to consume source is Mr messers network+ course on YouTube. ---------------------------------------------------------------------- NikStalwart · 2023-11-16 05:08 Mullvad discontinued port forwarding (they got tired of telling copyright trolls to bugger off) so there is no way for Port 8008 on your machine to be Port 8008 on the server side at mullvad's end. When it comes to VPN port forwarding, you usually cannot pick a target port anyway, you get assigned the next available WAN-facing port (>40000) anyway. So, TL;DR "That's not how this works. That's not how *any* of this works." Look into one or more of the following: * innernet * Cloudflare cnd * Cloudflare tunnels * tailscale / headscale ---------------------------------------------------------------------- DerreckValentine · 2023-11-16 16:11 A little bit, but that's why I'm doing it in tiny chunks. This isn't some crazy thing I'm trying to put into production. I'm just getting my feet wet. The networking aspect is what I'm trying to gain knowledge of. These courses seem like an excellent place for me to do that, so thanks! ---------------------------------------------------------------------- DerreckValentine · 2023-11-16 16:13 I kinda figured that was the case, but hoped it wasn't true. Thanks for the resources!