From 3b82ab5086f27353cc3e69a52d8bb2c8fd7e590c Mon Sep 17 00:00:00 2001 From: Amanda Kaufman <47929154+aka-msft@users.noreply.github.com> Date: Mon, 10 Jun 2019 13:30:28 -0600 Subject: [PATCH] Dockerfile (#5) * Added Dockerfile * Removed unnecessary line from Dockerfile * Readme updates * Fixing spacing in README --- Dockerfile | 7 +++++++ README.md | 31 ++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e50269 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:dubnium-alpine +WORKDIR /app +COPY . /app +RUN npm install \ + && npm run build +EXPOSE 3000 +ENTRYPOINT ["npm", "start"] diff --git a/README.md b/README.md index 5882b96..12b1c5f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ Helium UI is a React application built in TypeScript created to test and display - Formik - Handling state using React Forms and Dialogs -## Getting Started +# Getting Started + +## Run Locally with npm 1. Clone the repository 2. Open a terminal in the local respository directory @@ -20,6 +22,33 @@ Helium UI is a React application built in TypeScript created to test and display npm build && npm start ``` +## Run Locally with Docker + +1. Clone the repository +2. Open a terminal in the local repository directory +3. Build the application using +``` +docker build -t helium-ui . +``` + +4. Run the application using +``` +docker run -it -P helium-ui +``` + + In another terminal, run: +``` +docker ps +``` + + Output will show the port number the image is running on: +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS +1dafc0296c23 helium-ui "npm start" 24 seconds ago Up 23 seconds 0.0.0.0:32770->3000/tcp +``` + +5. In a browser, navigate to `http://localhost:` and the Helium UI should appear. + ## Contributing