-
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.
Added Prod features with AWS config in complex project
- Loading branch information
Sanchit Bhatnagar
committed
Sep 19, 2020
1 parent
98eb6ca
commit 38d5ca2
Showing
8 changed files
with
123 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
|
||
before_install: | ||
- docker build -t sanchitb23/react-test -f ./client/Dockerfile.dev ./client | ||
|
||
script: | ||
- docker run -r CI=true sanchitb23/react-test npm test | ||
|
||
after_success: | ||
- docker build -t sanchitb23/complex-client ./client | ||
- docker build -t sanchitb23/complex-nginx ./nginx | ||
- docker build -t sanchitb23/complex-server ./server | ||
- docker build -t sanchitb23/complex-worker ./worker | ||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin | ||
- docker push sanchitb23/complex-client | ||
- docker push sanchitb23/complex-nginx | ||
- docker push sanchitb23/complex-server | ||
- docker push sanchitb23/complex-worker | ||
|
||
deploy: | ||
edge: true | ||
provider: elasticbeanstalk | ||
region: us-west-1 | ||
app: mutli-docker | ||
env: MultiDocker-env | ||
bucket: s3bucketname | ||
bucket_path: docker-multi | ||
on: | ||
branch: master | ||
access_key_id: $AWS_ACCESS_KEY | ||
secret_access_key: $AWS_SECRET_KEY | ||
|
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,43 @@ | ||
{ | ||
"AWSEBDockerrunVersion": 2, | ||
"containerDefinitions": [ | ||
{ | ||
"name": "client", | ||
"image": "sanchitb23/complex-client", | ||
"hostname": "client", | ||
"memory": 128, | ||
"essential": false | ||
}, | ||
{ | ||
"name": "server", | ||
"image": "sanchitb23/complex-server", | ||
"hostname": "api", | ||
"memory": 128, | ||
"essential": false | ||
}, | ||
{ | ||
"name": "worker", | ||
"image": "sanchitb23/complex-worker", | ||
"hostname": "worker", | ||
"memory": 128, | ||
"essential": false | ||
}, | ||
{ | ||
"name": "nginx", | ||
"image": "sanchitb23/complex-nginx", | ||
"hostname": "nginx", | ||
"essential": true, | ||
"portMappings": [ | ||
{ | ||
"hostPort": 80, | ||
"containerPort": 80 | ||
} | ||
], | ||
"memory": 128, | ||
"links": [ | ||
"client", | ||
"server" | ||
] | ||
} | ||
] | ||
} |
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 as builder | ||
WORKDIR '/app' | ||
COPY ./package.json ./ | ||
RUN npm install | ||
COPY . . | ||
RUN npm run build | ||
|
||
FROM nginx | ||
EXPOSE 3000 | ||
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=builder /app/build /usr/share/nginx/html |
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,9 @@ | ||
server { | ||
listen 3000; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import App from './App'; | ||
|
||
test('renders learn react link', () => { | ||
const { getByText } = render(<App />); | ||
const linkElement = getByText(/learn react/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); | ||
test('renders learn react link', () => {}); |
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,3 @@ | ||
FROM nginx | ||
|
||
COPY ./default.conf /etc/nginx/conf.d/default.conf |
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 '/app' | ||
|
||
COPY ./package.json . | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
CMD ["npm","run","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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR '/app' | ||
|
||
COPY ./package.json . | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
CMD ["npm","run","start"] |