Build¶
Sampleitems Website requires content before running.
There is a two-step process using docker. The base app without content needs to be created as a docker image called code. Then we combine the code image with the content package using another dockerfile.
Before starting build¶
Locate the dockerfile.stage and dockerfile.prod files from github repo, navigate to deployScripts
Using a previous docker code image¶
To build a docker image for sample items website code base (without content) see Building from scratch
Docker¶
- Navigate to directory containing dockerfiles
- Get docker code repo for stage/prod, run
docker pull reponame:{tag}
- Example stage: run
docker pull xxx.dkr.ecr.us-west-2.amazonaws.com/sampleitemscode:stage
- Example producation: run
docker pull xxx.dkr.ecr.us-west-2.amazonaws.com/sampleitemscode:prod
- Example stage: run
- Docker tag code, run
docker tag reponame:{tag} sampleitemscode:{tag}
- Example stage: run
docker tag xxx.dkr.ecr.us-west-2.amazonaws.com/sampleitemscode:stage sampleitemscode:stage
- Example production: run
docker tag xxx.dkr.ecr.us-west-2.amazonaws.com/sampleitemscode:prod sampleitemscode:prod
- Example stage: run
- place content within deployScripts directory
- Content needs to be unzipped
- content directory root level needs Items directory
- Docker build, run
docker build -t sampleitemsapp:{tag} -f Dockerfile.{tag} .
- Example stage: run
docker build -t sampleitemsapp:stage -f Dockerfile.stage .
- Example production: run
docker build -t sampleitemsapp:prod -f Dockerfile.prod .
- Example stage: run
- Docker Run app , run
docker run -it -p 8012:80 sampleitemsapp:{tag}
- Example stage: run
docker run -it -p 8012:80 sampleitemsapp:stage
- Example production: run
docker run -it -p 8012:80 sampleitemsapp:prod
- Example stage: run
- Go to localhost:8012
- point to docker
Building from scratch¶
Dependencies¶
- See Project Dependencies
- Install Nodejs and npm
Dotnet build and Publish¶
cd SampleItemsWebsite\SmarterBalanced.SampleItems
dotnet restore
cd src\SmarterBalanced.SampleItems.Web
npm install
grunt all
dotnet publish -o ../../publish
cd ../../publish
Docker build¶
- Go to the publish directory containing the dockerfile
- Build app, run
docker build -t sampleitemscode:{tag}
- Example stage: run
docker build -t sampleitemscode:stage
- Example producation: run
docker build -t sampleitemscode:prod
- Example stage: run
Deploy Sample Items app¶
- see Publish Docker