Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Last active June 24, 2017 22:18
Show Gist options
  • Save lopezjurip/c6bf9d1c4edb368cb05b410f4d2c4e47 to your computer and use it in GitHub Desktop.
Save lopezjurip/c6bf9d1c4edb368cb05b410f4d2c4e47 to your computer and use it in GitHub Desktop.
Feathers.js + Docker + Caddy | SSL + HTTP2

Machine setup

Make sure to set FEATHERS_AUTH_SECRET on your deployment machine.

export FEATHERS_AUTH_SECRET=SECRET_KEY

Also you need to enable ports 80 and 443.

This files

Change your.domain.com to your domain and youremail@gmail.com to your email.

your.domain.com {
proxy / web:3030 {
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forwarded-Proto {scheme}
websocket
}
tls youremail@gmail.com
}
proxy:
image: zzrot/alpine-caddy
restart: always
ports:
- 80:80
- 443:443
links:
- web
volumes:
- ./Caddyfile:/etc/Caddyfile
- ./.caddy:/root/.caddy
web:
build: .
restart: always
links:
- mongo
environment:
- NODE_ENV=production
- FEATHERS_AUTH_SECRET
mongo:
image: mongo
FROM node:6-onbuild
EXPOSE 3030
{
"host": "your.domain.com",
"port": 3030,
"mongodb": "mongodb://mongo:27017/myapp",
"public": "../public/",
"auth": {
"idField": "id",
"token": {
"secret": "FEATHERS_AUTH_SECRET"
},
"local": {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment