Merge branch 'master' into patch-1

This commit is contained in:
Denis Skiba
2020-02-05 18:20:00 +04:00
committed by GitHub
5 changed files with 80 additions and 1 deletions

3
.gitignore vendored
View File

@@ -10,3 +10,6 @@
# production
**/build
**/npm-debug.log*
# Persistence Directory for Docker
**/persist

View File

@@ -1 +0,0 @@
I will not be accepting PR's on this repository. Feel free to fork and maintain your own version.

7
Dockerfile Normal file
View File

@@ -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"]

57
docker-compose.yml Normal file
View File

@@ -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:

13
docker/entrypoint.sh Executable file
View File

@@ -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