Skip to content

Commit 508219a

Browse files
authored
Add docker support (#9)
* remove mock project api * add docker support
1 parent 9eef45f commit 508219a

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Versioning and metadata
2+
.git
3+
.gitignore
4+
.dockerignore
5+
6+
# Build dependencies
7+
dist
8+
node_modules
9+
coverage
10+
.nyc_output
11+
12+
# Environment (contains sensitive data)
13+
.env
14+
15+
# Files not required for production
16+
.editorconfig
17+
docs
18+
Dockerfile*
19+
docker-compose.yml
20+
README.md
21+
tslint.json

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- nodejs https://nodejs.org/en/ (v12+)
66
- PostgreSQL
77
- ElasticSearch (7.x)
8+
- Docker
9+
- Docker-Compose
810

911
## Configuration
1012

@@ -55,6 +57,9 @@ The following parameters can be set in config files or in env variables:
5557
- Start app `npm start`
5658
- App is running at `http://localhost:3000`
5759

60+
## Docker Deployment
61+
- Run `docker-compose up`
62+
5863
## Testing
5964
- Run `npm run test` to execute unit tests
6065
- Run `npm run cov` to execute unit tests and generate coverage report.

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3'
2+
services:
3+
taas-apis:
4+
container_name: taas-apis
5+
build:
6+
context: .
7+
dockerfile: ./docker/Dockerfile
8+
ports:
9+
- '3000:3000'

docker/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
FROM node:latest
3+
4+
# Set working directory. Paths will be relative this WORKDIR.
5+
WORKDIR /usr/src/app
6+
7+
ENV NODE_CONFIG_DIR /usr/src/app/config/
8+
9+
# Install dependencies
10+
COPY package*.json ./
11+
RUN npm install
12+
13+
# Copy source files from host computer to the container
14+
COPY . .
15+
16+
17+
# Specify port app runs on
18+
EXPOSE 3000
19+
20+
# Run the app
21+
CMD [ "node", "app.js" ]

0 commit comments

Comments
 (0)