Initial commit

This commit is contained in:
Bradley Shellnut 2019-11-11 16:57:20 -08:00
parent 77f27fa108
commit 24e104aa04
5 changed files with 61 additions and 1 deletions

9
Dockerfile Normal file
View file

@ -0,0 +1,9 @@
FROM node:alpine as builder
WORKDIR '/app'
COPY package.json .
RUN npm install
COPY . .
RUN npm run build
FROM nginx
COPY --from=builder /app/build /usr/share/nginx/html

10
Dockerfile.dev Normal file
View file

@ -0,0 +1,10 @@
FROM node:alpine
WORKDIR '/app'
COPY package.json .
RUN npm install
COPY . .
CMD ["npm", "run", "start"]

19
docker-compose.yml Normal file
View file

@ -0,0 +1,19 @@
version: '3'
services:
web:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- /app/node_modules
- .:/app
tests:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- /app/node_modules
- .:/app
command: ["npm", "run", "test"]

View file

@ -8,7 +8,7 @@ function App() {
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
Hello there!
</p>
<a
className="App-link"

22
travis.yml Normal file
View file

@ -0,0 +1,22 @@
language: generic
sudo: required
services:
- docker
before_install:
- docker build -t bradleyshellnut/docker-react -f Dockerfile.dev
script:
- docker run -e CI=true braldeyshellnut/docker-react npm run test -- --coverage
deploy:
provider: elasticbeanstalk
region: "us-west-2"
app: "docker-react"
env: "Docker-react-env"
bucket_name: ""
bucker_path: "docker-react"
on:
branch: master
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY