diff --git a/Dockerfile b/Dockerfile index 8ce2bd8..b2e45fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:9.8.0 as builder +FROM node:9.8.0-alpine as builder ARG GMAPS_API_KEY WORKDIR oldto-site @@ -6,7 +6,7 @@ COPY oldto-site . ENV GMAPS_API_KEY $GMAPS_API_KEY RUN yarn && yarn webpack -FROM nginx +FROM nginx:1.13.12-alpine COPY --from=builder oldto-site/dist /usr/share/nginx/html COPY nginx.config /etc/nginx/conf.d/default.conf diff --git a/README.md b/README.md index 12e3679..e212018 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,27 @@ for popular locations like the CN Tower or City Hall. * Live site: https://oldtoronto.sidewalklabs.com -## Development setup +## :computer: Local Development + +If you're willing to install docker, it is usually the simplest way to +get up and running. + +### Docker + +**Docker** is a tool that helps isolate your development environment. + +**Requirements:** +- Docker (tested on v17.10.0) +- Docker Compose (tested in v1.16.1) + +``` +$ cd path/to/oldto +$ docker-compose up +``` + +You may now view the webapp at: [`localhost:5000`][http://localhost:5000] + +### Manually Setup dependencies (on a Mac): diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a79529e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3' +services: + webapp: + build: + context: . + dockerfile: Dockerfile + ports: + - "5000:80" diff --git a/nginx.config b/nginx.config index 84cf5f3..4924950 100644 --- a/nginx.config +++ b/nginx.config @@ -13,6 +13,6 @@ server { # proxy the /api to connect to the API server: location /api { - proxy_pass http://swl-api-server-web:8000; + proxy_pass http://api.sidewalklabs.com; } }