From 8f78bd5092712aa584662aee7dc27d4bd0876d65 Mon Sep 17 00:00:00 2001
From: Ben Mitchinson
Date: Tue, 11 Feb 2020 16:24:41 -0600
Subject: [PATCH 1/6] Dockerfile for PWA - Needs Compose + Volumes
---
pwa/.dockerignore | 2 ++
pwa/Dockerfile | 16 ++++++++++++++++
2 files changed, 18 insertions(+)
create mode 100644 pwa/.dockerignore
create mode 100644 pwa/Dockerfile
diff --git a/pwa/.dockerignore b/pwa/.dockerignore
new file mode 100644
index 0000000..929dccc
--- /dev/null
+++ b/pwa/.dockerignore
@@ -0,0 +1,2 @@
+node_modules
+npm-debug.log*
\ No newline at end of file
diff --git a/pwa/Dockerfile b/pwa/Dockerfile
new file mode 100644
index 0000000..a8041eb
--- /dev/null
+++ b/pwa/Dockerfile
@@ -0,0 +1,16 @@
+FROM node:12.10.0
+
+WORKDIR /app
+# cd app folder within container.
+
+COPY package*.json ./
+
+RUN npm install
+
+COPY . .
+# copy {everything in PWA} {WORKDIR (/app)}
+# this is okay because node_modules is ignored
+
+EXPOSE 3000
+
+CMD ["npm", "start"]
\ No newline at end of file
From 457bbd9ad9a97a6b42a7945c6673268b81ee876d Mon Sep 17 00:00:00 2001
From: Ben Mitchinson
Date: Tue, 11 Feb 2020 16:39:14 -0600
Subject: [PATCH 2/6] compose with mounted volumes
---
docker-compose.yml | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 docker-compose.yml
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..6165d62
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,12 @@
+version: '3'
+
+services:
+ pwa:
+ build:
+ context: ./pwa
+ command: npm start
+ volumes:
+ - ./pwa/:/app
+ ports:
+ - "8000:3000"
+
\ No newline at end of file
From 14f7ae67297741bfa082322e7166b8f6bdf14518 Mon Sep 17 00:00:00 2001
From: abpwrs
Date: Wed, 12 Feb 2020 11:43:42 -0600
Subject: [PATCH 3/6] ENH: changing from port 8000 to 3000 for consistency
---
docker-compose.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index 6165d62..652a30b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,5 +8,5 @@ services:
volumes:
- ./pwa/:/app
ports:
- - "8000:3000"
+ - "3000:3000"
\ No newline at end of file
From 64e766e90d0391eaf74e7edfe675c31b6efc8be9 Mon Sep 17 00:00:00 2001
From: Ben Mitchinson
Date: Fri, 14 Feb 2020 09:50:27 -0600
Subject: [PATCH 4/6] name the pwa container
---
docker-compose.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index 6165d62..50999bc 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,4 +9,4 @@ services:
- ./pwa/:/app
ports:
- "8000:3000"
-
\ No newline at end of file
+ container_name: haiti_pwa
\ No newline at end of file
From 90b44ebdba5280b874451c1e61c24b8f4359c164 Mon Sep 17 00:00:00 2001
From: Ben Mitchinson
Date: Sun, 16 Feb 2020 02:12:37 -0600
Subject: [PATCH 5/6] corrected node_modules logic
---
docker-compose.yml | 1 -
pwa/Dockerfile | 14 +++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index 36c19ec..8c8a8a3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,7 +4,6 @@ services:
pwa:
build:
context: ./pwa
- command: npm start
volumes:
- ./pwa/:/app
ports:
diff --git a/pwa/Dockerfile b/pwa/Dockerfile
index a8041eb..397c7e0 100644
--- a/pwa/Dockerfile
+++ b/pwa/Dockerfile
@@ -1,16 +1,16 @@
FROM node:12.10.0
-WORKDIR /app
-# cd app folder within container.
+COPY package*.json ./data/
-COPY package*.json ./
+WORKDIR /data
RUN npm install
-COPY . .
-# copy {everything in PWA} {WORKDIR (/app)}
-# this is okay because node_modules is ignored
+ENV PATH /data/node_modules/.bin:$PATH
+
+COPY . /data/app
+WORKDIR /data/app
EXPOSE 3000
-CMD ["npm", "start"]
\ No newline at end of file
+CMD ["npm", "start"]
From 0d9d87ecf153093df5cda9be80e7f0b02aa504df Mon Sep 17 00:00:00 2001
From: Ben Mitchinson
Date: Mon, 17 Feb 2020 08:33:05 -0600
Subject: [PATCH 6/6] Update README.md
---
README.md | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index dc72f36..22d218b 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,19 @@
-# hdhs
-Haiti Distributed Healthcare System
+
+
+
Haiti Community Health Initiative Application
+
+
+ A containerized progressive web application paired with patient data management tooling built to serve the Haiti Community Health Initiative in their mission to help form healthy and self-directed communities in Haiti.
+
+
+---
+
+## Getting Started
+
+The application runs on docker, which can be installed [here](https://docs.docker.com/install/).
+If you're a linux user, you'll also need to install [docker-compose](https://docs.docker.com/compose/install/) separately. Otherwise, it's included in the Mac and PC versions of "Docker Desktop"
+
+- The PWA and accompanying database can be started by running the command `docker-compose up` from the root directory.
+ - `docker-compose down` will then stop the docker processes from running in the background.
+- Once the images have been built and the processes started, the PWA can be seen at your localhost, at the port specified in [docker-compose.yml](https://github.com/Haiti-Distributed-Healthcare-System/hdhs/blob/dev/docker-compose.yml).
+- More tips to troubleshoot docker are available [here](https://github.com/Haiti-Distributed-Healthcare-System/hdhs/wiki/Using-Docker).