SF Life Line (https://www.sanfranciscolifeline.com/) creates and distributes free communication tools to help bridge language barriers between patients and first responders in emergency medicine. This collaboration with SF Civic Tech (https://www.sfcivictech.org/) is building a complementary technology to augment those tools with a web-based app that can be accessed on any smartphone, tablet, or computer.
-
Install Docker Desktop.
-
Clone the repo to a directory on your computer.
-
Create a
.env
file in the/server
directory with the values from the.env.example
file. -
In a command-line shell, navigate to the repo directory. Inside the root directory of this project, run
docker compose up
. It may take a few minutes to download and/or build the necessary images to run the codebase. -
To run commands related to the codebase, you should first "log in" to the running server to execute them in the container so that you have access to installed dependencies. To do so, leave the server running in one shell, open another in the same repo directory, then run
docker compose exec server bash -l
. You can then execute commands likenpm install
, etc.Note that the configuration does not share dependencies like
node_modules
between your host OS file system and the container to prevent mismatches (i.e. dependencies with native binaries that won't be the same inside the Linux-based container vs a Windows/Mac host). -
If you're using VSCode as an editor, you can improve auto-completion and syntax highlighting by using the Dev Containers extension to connect to the running container so it has access to installed dependencies. Once you attach to the running container, you can open the "remote folder"
/opt/node/app
which is where the code is located inside the container. -
To stop the application, you can press CONTROL-C inside the shell where you ran
docker compose up
.If you've "logged in" to the server container using
docker compose exec server bash -l
, press CONTROL-D or typeexit
orlogout
to exit the container back to your host OS shell.If the application does not terminate gracefully after CONTROL-C (use
docker ps
to see running processes), rundocker compose stop
to terminate any running processes.
- On macOS, if you're unable to start the server listening on port 5000, go to System Preferences, search for Airplay Receiver, and turn it off to release the port.
SF Life Line
Copyright © 2024 SF Civic Tech
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.