Skip to content

Instantly share code, notes, and snippets.

@nodece
Last active June 9, 2019 08:43
Show Gist options
  • Save nodece/e5c86c2475b4dab16a46991c0c595938 to your computer and use it in GitHub Desktop.
Save nodece/e5c86c2475b4dab16a46991c0c595938 to your computer and use it in GitHub Desktop.
Deploy the SPA to Docker

Support HTML5 History Mode.

Build script

docker build -t dockerId/imageName .

Run script

docker run -d -v $HOME/.caddy:/root/.caddy -p 80:80 -p 443:443 dockerId/imageName
app.com {
tls email
log stdout
rewrite {
regexp .*
to {path} /
}
}
app.com/api {
log stdout
proxy / backend.com:80 {
transparent
websocket
}
}
FROM abiosoft/caddy
EXPOSE 80 443
COPY Caddyfile /etc/Caddyfile
COPY dist/ /srv/
ENV ACME_AGREE="true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment