From 40a15d126fb335be5802c5c1fc95c96663cf003a Mon Sep 17 00:00:00 2001 From: Colin_ Date: Tue, 28 Jan 2020 19:22:59 -0500 Subject: [PATCH 1/2] Added basic Docker support --- .gitignore | 3 +++ Dockerfile | 7 ++++++ docker-compose.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++ docker/entrypoint.sh | 13 ++++++++++ 4 files changed, 80 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100755 docker/entrypoint.sh diff --git a/.gitignore b/.gitignore index 424b2f0..5c544b1 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ # production **/build **/npm-debug.log* + +# Persistence Directory for Docker +**/persist diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f939c0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:lts-alpine +RUN adduser jira-clone --gecos GECOS --shell /bin/bash --disabled-password --home /app +COPY . /app +WORKDIR /app +RUN npm run install-dependencies && \ + cp -v /app/docker/entrypoint.sh /usr/bin/entrypoint +ENTRYPOINT ["entrypoint"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5732a70 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,57 @@ +version: "3.4" + +services: + db: + image: postgres:9.6-alpine + restart: always + environment: + - POSTGRES_USER=jira-clone + - POSTGRES_PASSWORD=jira-clone + - POSTGRES_DB=jira-clone + networks: + - default + volumes: + - ./persist/db/git:/var/lib/postgresql/data + + api: + build: . + restart: always + environment: + - NODE_ENV=development + - DB_HOST=db + - DB_PORT=5432 + - DB_USERNAME=jira-clone + - DB_PASSWORD=jira-clone + - DB_DATABASE=jira-clone + ## Please change this string to something unique. + - JWT_SECRET=development12345 + command: ["api"] + depends_on: + - db + networks: + - default + + client: + build: . + restart: always + environment: + ports: + - 8080:8080 + networks: + - default + environment: + - RUN_MODE=api + - NODE_ENV=development + - DB_HOST=localhost + - DB_PORT=5432 + - DB_USERNAME=jira-clone + - DB_PASSWORD=jira-clone + - DB_DATABASE=jira-clone + ## Please change this string to something unique. + - JWT_SECRET=development12345 + depends_on: + - api + command: ["client"] + +networks: + default: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000..be1a608 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +case $1 in + api ) + cd /app/api/ && npm start + ;; + client ) + cd /app/client && npm start + ;; + * ) + echo "The only two supported run modes are client and api, giving you a shell instead." + /bin/sh + ;; +esac From c7b01c6ad344fbf4fa971e0bfda6eaac065f65a1 Mon Sep 17 00:00:00 2001 From: Leopere <1068374+Leopere@users.noreply.github.com> Date: Sat, 1 Feb 2020 14:50:59 -0500 Subject: [PATCH 2/2] Loose guidelines for CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a32e3d1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,4 @@ +# Newcomers will be inducted +Any PR's are welcomed not all will be accepted immediately at least until we get [GOVERNANCE.md](/GOVERNANCE.md) defined clearly in [#3](https://github.com/FauxJira/FauxJira/issues/3). + +However, as soon as you contribute a PR I will try and induct you as I would love to recruit people as this won't be my main focus so I'll just meta manage long term.