Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile and Compose #26

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cache/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:8.6.0

# Run a command for creating the following path on container
RUN mkdir -p /usr/cache-service

# Sets the work directory of our app to be the new path
WORKDIR /usr/cache-service

# Copy all files from current directory to the new path in container
COPY . /usr/cache-service

# Run the command for installing our node dependencies
RUN npm install

# Define the command that will execute when the container start
CMD npm start
22 changes: 5 additions & 17 deletions Cache/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "cache-service",
"name": "web-server",
"version": "1.0.0",
"description": "redis-webserver",
"main": "index.js",
"scripts": {
"start": "nodemon --exec babel-node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Casey Wylie",
"author": "",
"license": "ISC",
"dependencies": {
"@babel/cli": "^7.6.0",
Expand All @@ -20,27 +20,15 @@
"dotenv": "^8.1.0",
"express": "^4.17.1",
"express-session": "^1.16.2",
"extend": "^3.0.2",
"helmet": "^3.21.0",
"ioredis": "^4.14.1",
"keycloak-admin": "^1.12.0",
"keycloak-connect": "^7.0.0",
"multer": "^1.4.2",
"nodemon": "^1.19.2",
"redis": "^2.8.0",
"request": "^2.88.0",
"socket.io": "^2.2.0"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/cmwylie19/patternfly-chat.git"
},
"keywords": [
"cache",
"socket-io",
"node"
],
"bugs": {
"url": "https://github.com/cmwylie19/patternfly-chat/issues"
},
"homepage": "https://github.com/cmwylie19/patternfly-chat#readme"
}
}
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:8.6.0

# Run a command for creating the following path on container
RUN mkdir -p /usr/frontend

# Sets the work directory of our app to be the new path
WORKDIR /usr/frontend

# Copy all files from current directory to the new path in container
COPY . /usr/frontend

# Delete the Cache folder from frontend container
RUN rm -rf Cache

# Run the command for installing our node dependencies
RUN npm install

# Define the command that will execute when the container start
CMD npm start
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "2"
services:
redis:
image: "redis"
ports:
- "6379:6379"
keycloak:
image: "jboss/keycloak"
ports:
- "8080:8080"
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- DB_VENDOR=H2
depends_on:
- redis
cache-service:
build: ./Cache
ports:
- "3332:3332"
environment:
- REDIS_URL=redis://localhost
links:
- redis
depends_on:
- redis
frontend:
build: ./
ports:
- "3002:3002"
depends_on:
- cache-service