This repository contains build files that can be used to launch a development environment for Project Sidewalk using Docker.
-
Follow instructions to install Docker for your OS.
-
Install docker-compose.
-
Clone this repository:
$ git clone https://github.com/tongning/sidewalk-docker.git
-
Obtain a database dump from the Project Sidewalk team and move it into
docker/postgres, naming itsidewalk.sql:$ mv /path/to/databasedump.sql sidewalk-docker/docker/postgres/sidewalk.sql
-
Enter the repository folder and clone the Project Sidewalk platform:
$ cd sidewalk-docker $ git clone https://github.com/ProjectSidewalk/SidewalkWebpage.git -
Build and run:
# Run with sudo if necessary $ docker-compose upFirst launch can take a long time for all components to download and build. Once completed, you should see a message like the following:
Listening for HTTP on /0:0:0:0:0:0:0:0%0:9000Once you see this message, visit
http://localhost:9000to see the webpage.Important note:
You may encounter errors related to failed downloads of Scala components. To resolve them, just quit (Ctrl+C) and rerun
docker-compose upuntil all components download successfully. This is a known issue. -
You are finished! Edit the code in the SidewalkWebpage folder, and the site will rebuild automatically. You can also connect a debugger to port 9999 on your local machine. We recommend using an IDE, such as IntelliJ.
The docker-compose.yml file sets up three linked Docker containers - postgres, web, and grunt.
postgreshosts the sites PostgreSQL database, which stores users data, labels, and other information. If you need to view or modify database entries directly, you can do so by connecting a Postgres client (e.g. pgAdmin) to port 5432 on your host machine.webruns the Scala web application using Activator.gruntruns the nodejs "grunt" module on the source files. It watches for changes in Javascript files and copies Javascript code to the correct locations.