This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from AJRedDevil/develop
Dockerize
- Loading branch information
Showing
15 changed files
with
221 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,4 +123,4 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
# Redis | ||
worker/data | ||
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.git | ||
*Dockerfile* | ||
*docker-compose* | ||
node_modules | ||
npm-debug.log | ||
logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
|
||
COPY . . | ||
|
||
EXPOSE 5000 | ||
CMD ["yarn", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
"express": "4.17.1", | ||
"redis": "2.8.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.git | ||
*Dockerfile* | ||
*docker-compose* | ||
node_modules | ||
npm-debug.log | ||
logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
FROM nginx:1.15.10-alpine | ||
COPY --from=builder /app/build /var/www | ||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
events { | ||
worker_connections 4096; ## Default: 1024 | ||
} | ||
http { | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
include /etc/nginx/mime.types; | ||
# root /var/www; | ||
# index index.html index.htm; | ||
location /api { | ||
resolver 127.0.0.11; | ||
proxy_set_header X-Forwarded-Host $host; | ||
proxy_set_header X-Forwarded-Server $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_pass http://api:5000$request_uri; | ||
} | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ =404; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: '3.7' | ||
services: | ||
client: | ||
image: ajreddevil/client-job-board | ||
restart: always | ||
container_name: client | ||
ports: | ||
- '80:80' | ||
links: | ||
- api | ||
depends_on: | ||
- api | ||
networks: | ||
- webappnetwork | ||
api: | ||
image: ajreddevil/api-job-board | ||
restart: always | ||
container_name: api | ||
ports: | ||
- '5000:5000' | ||
environment: | ||
NODE_ENV: 'docker' | ||
depends_on: | ||
- redis | ||
networks: | ||
- webappnetwork | ||
worker: | ||
image: ajreddevil/worker-job-board | ||
restart: always | ||
container_name: worker | ||
environment: | ||
NODE_ENV: 'docker' | ||
depends_on: | ||
- redis | ||
networks: | ||
- webappnetwork | ||
redis: | ||
image: redis | ||
restart: always | ||
container_name: redis | ||
volumes: | ||
- ${PWD}/data:/data | ||
ports: | ||
- 6379:6379 | ||
command: redis-server --appendonly yes | ||
networks: | ||
- webappnetwork | ||
networks: | ||
webappnetwork: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# API | ||
dockerize-api: | ||
docker build -t ajreddevil/api-job-board api/ | ||
|
||
start-api: | ||
docker run --name api \ | ||
-p 5000:5000 \ | ||
--restart unless-stopped \ | ||
--link redis:redis \ | ||
-e NODE_ENV=docker \ | ||
-d ajreddevil/api-job-board | ||
|
||
stop-api: | ||
docker stop api | ||
docker rm api | ||
|
||
view-api-logs: | ||
docker logs -f api | ||
|
||
# Client | ||
dockerize-client: | ||
docker build -t ajreddevil/client-job-board client/ | ||
|
||
start-client: | ||
docker run --name client \ | ||
-p 3000:3000 \ | ||
--restart unless-stopped \ | ||
-d ajreddevil/client-job-board | ||
|
||
stop-client: | ||
docker stop client | ||
docker rm client | ||
|
||
view-client-logs: | ||
docker logs -f client | ||
|
||
# worker | ||
dockerize-worker: | ||
docker build -t ajreddevil/worker-job-board worker/ | ||
|
||
start-worker: | ||
docker run --name worker \ | ||
--restart unless-stopped \ | ||
--link redis:redis \ | ||
-e NODE_ENV=docker \ | ||
-d ajreddevil/worker-job-board | ||
|
||
stop-worker: | ||
docker stop worker | ||
docker rm worker | ||
|
||
view-worker-logs: | ||
docker logs -f worker | ||
|
||
# Redis | ||
download-redis: | ||
docker pull redis | ||
|
||
setup-volume: | ||
mkdir data | ||
|
||
start-redis: | ||
docker run --name redis \ | ||
--restart unless-stopped \ | ||
-v ${PWD}/data:/data\ | ||
-p 6379:6379 \ | ||
-d redis redis-server --appendonly yes | ||
|
||
stop-redis: | ||
docker stop redis | ||
docker rm redis | ||
|
||
# RUN cmd | ||
run-job-board: | ||
docker-compose -p job-board up -d | ||
|
||
stop-job-board: | ||
docker-compose -p job-board down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.git | ||
*Dockerfile* | ||
*docker-compose* | ||
node_modules | ||
npm-debug.log | ||
logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
|
||
COPY . . | ||
|
||
CMD ["yarn", "start"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters