I am following the tutorial in this blog. According to the tutorial once the nginx-proxy and let’sencrypt is setup the other apps need the docker-compose.yml file like so to work with the proxy:
version: '3'
services:
example-app:
image: example/example-app
expose:
- 80
environment:
VIRTUAL_HOST: app.example.com
LETSENCRYPT_HOST: app.example.com
LETSENCRYPT_EMAIL: foo@example.com
networks:
default:
external:
name: nginx-proxy
For my nodejs app I’ve setup my docker-compose.yml file as follows:
version: '3'
services:
app:
image: node:carbon
expose:
- 80
volumes:
- .:/home/path/to/code
environment:
VIRTUAL_HOST: app.example.com
LETSENCRYPT_HOST: app.example.com
LETSENCRYPT_EMAIL: foo@example.com
command: npm start
networks:
default:
external:
name: nginx-proxy
I’ve setup simple package.json and index.js files to run a Hello World app. I run docker-compose up -d, which runs without issues and adds the website. However, when I go to the domain, I get an nginx 503 error. I was wondering if anyone could help point me in the right direction, or maybe even take a different approach to this problem if needed.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Did you ever figure out a solution to this? I just tried to follow the same blog and ran into the same issue.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.