forked from brentley/ecsdemo-nodejs
-
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.
- Loading branch information
0 parents
commit 2c7781e
Showing
12 changed files
with
1,042 additions
and
0 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,3 @@ | ||
node_modules | ||
npm-debug.log | ||
.git |
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 @@ | ||
node_modules |
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,20 @@ | ||
# FROM node:alpine | ||
FROM alpine:3.6 | ||
|
||
# set the default NODE_ENV to production | ||
# for dev/test build with: docker build --build-arg NODE=development . | ||
# and the testing npms will be included | ||
ARG NODE=production | ||
ENV NODE_ENV ${NODE} | ||
|
||
# copy package info early to install npms and delete npm command | ||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
RUN apk -U add nodejs nodejs-npm && \ | ||
npm install && apk del --purge nodejs-npm && \ | ||
rm -rvf /var/cache/* /root/.npm /tmp/* | ||
|
||
# copy the code | ||
COPY . . | ||
EXPOSE 3000 | ||
CMD [ "node", "server.js" ] |
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 @@ | ||
# Amazon ECS Workshop | ||
|
||
This is part of an Amazon ECS workshop at https://ecsworkshop.com |
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,13 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- export IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) | ||
- export ACCOUNT=$(echo $CODEBUILD_BUILD_ARN |cut -f5 -d:) | ||
- export $(cat mu-env.sh) | ||
- echo '***** This is the current env:' | ||
- printenv | ||
build: | ||
commands: | ||
- curl -m3 -sL -w "%{http_code}\\n" "$BASE_URL" -o /dev/null |
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,32 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- export IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) | ||
- export ACCOUNT=$(echo $CODEBUILD_BUILD_ARN |cut -f5 -d:) | ||
- echo '***** This is the current env:' | ||
- printenv | ||
#- echo '***** Download nodejs repo:' | ||
#- curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - | ||
#- echo '***** install nodejs:' | ||
#- apt-get install -y nodejs build-essential | ||
#- echo '***** install our npms:' | ||
#- npm install | ||
build: | ||
commands: | ||
#- echo '***** run tests:' | ||
#- npm test -- > testresult.txt | ||
# - docker build -t myimage . | ||
post_build: | ||
commands: | ||
- printf '[{"name":"example-backend","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json | ||
- echo $IMAGE_TAG > code_hash.txt | ||
# - docker pull anchore/cli | ||
# - docker run -d -v $(pwd):/source-dir -v /var/run/docker.sock:/var/run/docker.sock --name anchore anchore/cli:latest | ||
# - docker exec anchore anchore feeds sync | ||
# - docker exec anchore anchore analyze --image myimage --dockerfile /source-dir/Dockerfile | ||
|
||
artifacts: | ||
files: | ||
- '**/*' |
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 @@ | ||
NOHASH |
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,16 @@ | ||
--- | ||
service: | ||
desiredCount: 3 | ||
maxSize: 6 | ||
port: 3000 | ||
priority: 50 | ||
pathPatterns: | ||
- /* | ||
networkMode: awsvpc | ||
parameters: | ||
'mu-service-ecsdemo-nodejs-acceptance': | ||
ElbHttpListenerArn: | ||
mu-loadbalancer-acceptance-BackendLBHttpListenerArn | ||
'mu-service-ecsdemo-nodejs-production': | ||
ElbHttpListenerArn: | ||
mu-loadbalancer-production-BackendLBHttpListenerArn |
Oops, something went wrong.