Skip to content

Commit

Permalink
Merge pull request #1 from sabbour/master
Browse files Browse the repository at this point in the history
Added code
  • Loading branch information
sabbour committed Dec 28, 2019
2 parents 512d568 + 2e03647 commit 8b9ea42
Show file tree
Hide file tree
Showing 29 changed files with 10,688 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
*Dockerfile*
.gitignore
node_modules
.DS_Store
*.md
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

.DS_Store
dist/
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:13.5-alpine

WORKDIR /usr/src/app

# Install build dependencies via apk
RUN apk update && apk add python g++ make && rm -rf /var/cache/apk/*

# Install node dependencies - done in a separate step so Docker can cache it
COPY package*.json ./
RUN npm install

# Copy project files into the image
COPY . .

# Expose port 8080, which is what the node process is listening to
EXPOSE 8080

# Set the startup command to 'npm start'
CMD [ "npm", "start"]
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
page_type: sample
languages:
- csharp
- nodejs
products:
- dotnet
- nodejs
description: "Add 150 character max description"
urlFragment: "update-this-to-unique-url-stub"
---

# Official Microsoft Sample
# AKS Workshop - ratings-web sample code

<!--
Guidelines on README format: https://review.docs.microsoft.com/help/onboard/admin/samples/concepts/readme-template?branch=master
Expand All @@ -18,36 +18,43 @@ Guidance on onboarding samples to docs.microsoft.com/samples: https://review.doc
Taxonomies for products and languages: https://review.docs.microsoft.com/new-hope/information-architecture/metadata/taxonomies?branch=master
-->

Give a short description for your sample here. What does it do and why is it important?
This code is part of the Microsoft Learn module of the AKS workshop. It provides the frontend for the ratings application.

## Contents

Outline the file contents of the repository. It helps users navigate the codebase, build configuration and any related assets.

| File/folder | Description |
|-------------------|--------------------------------------------|
| `src` | Sample source code. |
| `static` | Data and images. |
| `.gitignore` | Define what to ignore at commit time. |
| `CHANGELOG.md` | List of changes to the sample. |
| `CONTRIBUTING.md` | Guidelines for contributing to the sample. |
| `.dockerignore` | Define what to ignore at build time. |
| `Dockerfile` | Define how the Docker image is built. |
| `README.md` | This README file. |
| `LICENSE` | The license for the sample. |

## Prerequisites

Outline the required components and tools that a user might need to have on their machine in order to run the sample. This can be anything from frameworks, SDKs, OS versions or IDE releases.
To build this sample locally, you can either build using Docker, or using NPM.

- Install [Docker](https://www.docker.com/get-started)
- Install [NodeJS](https://nodejs.org/en/download/)

## Setup

Explain how to prepare the sample once the user clones or downloads the repository. The section should outline every step necessary to install dependencies and set up any settings (for example, API keys and output folders).
- To build using Docker, in the project folder, run `docker build -t ratings-web .`
- To build using NPM, in the project folder, run `npm install`

## Running the sample

Outline step-by-step instructions to execute the sample and see its output. Include steps for executing the sample from the IDE, starting specific services in the Azure portal or anything related to the overall launch of the code.
- To run using Docker, run `docker run -it -p 8080:8080 ratings-web`
- To run using NPM, run `npm start`

Required configuration via environment variables:

## Key concepts
- API: `<set to rating-api endpoint>`. This *does not* have to be publicly accessible. The application proxies the API requests via the backend to the rating-api endpoint.

Provide users with more context on the tools and services used in the sample. Explain some of the code that is being used and how services interact with each other.
The application exposes port 8080.
You should then be able to access the application at <http://localhost:8080>.

## Contributing

Expand Down
Loading

0 comments on commit 8b9ea42

Please sign in to comment.