Add a production deployment

This commit is contained in:
R. Tyler Croy 2018-08-11 16:29:09 -07:00
parent c5e6489dbf
commit c36d179078
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 34 additions and 3 deletions

24
backend/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM node:9 as builder
ARG APP_DIR=/srv/howyoucanhelpus
WORKDIR ${APP_DIR}
ADD package*json ${APP_DIR}/
RUN npm install
# Doing a multi-stage build to reset some stuff for a smaller image
FROM node:9-alpine
ARG APP_DIR=/srv/howyoucanhelpus
WORKDIR ${APP_DIR}
COPY --from=builder ${APP_DIR} .
COPY src ${APP_DIR}/src
COPY config ${APP_DIR}/config
COPY public ${APP_DIR}/public
EXPOSE 3030
CMD npm run start

View File

@ -23,6 +23,13 @@ clean:
watch:
jest --watchAll
container: Dockerfile
docker build -t howyoucanhelpus.azurecr.io/webapp:latest .
deploy: container
docker push howyoucanhelpus.azurecr.io/webapp:latest && \
az webapp restart -n howyoucanhelpus-docker -g hychu
.PHONY: all depends build clean check watch
# vim: set et

View File

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>How You Can Help Us</title>
<title>howyoucanhelp.us</title>
</head>
<body>
<main class="container">
<h2 class="center-text">A backend to support howyoucanhelp.us</h2>
<h2 class="center-text">How You Can Help Us?</h2>
<footer>
<p class="center-text">From the civic hackers who also built <a href="https://sonomafireinfo.org/">Sonoma Fire Info.org</a>.</p>
<p class="center-text">From the civic-minded hackers who also built <a href="https://sonomafireinfo.org/">Sonoma Fire Info.org</a>.</p>
</footer>
</main>
</body>