Hey everyone! I'm a computer science student working on my web development project, and I've hit a wall during the deployment phase. I thought deploying just meant picking a hosting service like Vercel or Render, but it turns out those are more for static sites. I learned I need to set up reverse proxies for security and load balancing, so I've been using Traefik in my Docker Compose setup. Here's a snippet of my config:
```yaml
networks:
traefik_public:
external: false
services:
traefik:
image: traefik:3.5.0
command:
- --entrypoints.websecure.address=:443
- --providers.docker=true
- --log.level=info
- --certificatesresolvers.myresolver.acme.tlschallenge=true
- [email protected]
- --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json
ports:
- "443:443"
- "8080:8080"
volumes:
- ./letsencrypt:/letsencrypt
networks:
- traefik_public
backend:
build: ./server/node_server
labels:
- traefik.enable=true
- traefik.http.routers.backend.rule=PathPrefix(`/api`)
- traefik.http.services.backend.loadbalancer.server.port=3000
networks:
- traefik_public
# [...] including more services
```
However, I'm really lost on how to implement TLS certification properly in this setup. Here are a few specific questions I have:
1. Is my Traefik configuration set up correctly, and should I include Traefik in all other services?
2. I've heard it's better to create separate networks for the database and backend for security; is this accurate?
3. What's the correct way to connect my services to a domain?
4. Lastly, where's the best place to host this Docker container (like Digital Ocean or Cloudflare VPS)?
I really appreciate any help you can provide to a struggling dev!
1 Answer
About your Traefik setup, it looks like you're on the right track! However, make sure to dive into the Traefik documentation for specifics, especially related to the cert resolver you're using. It can be a bit tricky to get everything right, but don't hesitate to check forums specific to Traefik for more tailored help.

Thanks for the tip! I'll definitely check out the docs more carefully.