Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:9.8.0 as builder
FROM node:9.8.0-alpine as builder
ARG GMAPS_API_KEY

WORKDIR oldto-site
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
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
webapp:
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:80"
2 changes: 1 addition & 1 deletion nginx.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ server {

# proxy the /api to connect to the API server:
location /api {
proxy_pass http://swl-api-server-web:8000;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this isn't visible in Dockerland, but it is visible when this Docker image is deployed on our Kubernetes cluster (where oldto is hosted). We haven't open sourced this API server (yet!) which admittedly makes this a bit confusing. For local development, api.sidewalklabs.com or at an instance of the local dev server (oldtoronto/devserver.py) are good alternatives.

We might want to pass the location of this server in via an environment variable or flag so that we can distinguish "in production" and "local development" more easily.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah man, that sounds good. Maybe based on a check that y'all have in prod, it could just add an /etc/hosts entry? Just chose api.sidewalklabs.com as a quick fix for now. Happy to riff later

proxy_pass http://api.sidewalklabs.com;
}
}