GithubHelp home page GithubHelp logo

grandsgt / business-contacts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from multiverselearningproducts/business-contacts

0.0 0.0 0.0 236 KB

An application serving up business contacts, via Node, Express, and React

JavaScript 70.59% CSS 15.79% HTML 11.04% Dockerfile 2.57%

business-contacts's Introduction

Client Dockerfile setup

  1. Locate the client folder directory.
  2. Create a new file named Dockerfile in the client directory.
  3. Copy the following instructions into the Dockerfile:

FROM node:18-alpine

WORKDIR /app

COPY . /app

RUN apk add g++ make py3-pip

RUN npm install && npm run build

EXPOSE 1234

CMD ["node", "server.js"]

  1. Make sure that all the project files are inside the directory, otherwise the COPY . /app command will not work correctly.

  2. In the terminal, navigate to the project directory and run the following command:

docker build -t project-name

This command will build the Docker image and tag it as "project-name".

  1. To run the container, use the following command:

docker run -p 1234:1234 project-name

This command will run the container and map the host port 1234 to the container's port 1234.

  1. The service can be accessed via http://localhost:1234

Server Dockerfile setup

  1. Create a new folder named server in your project directory.
  2. Using a text editor, create a new file named Dockerfile in the server folder.
  3. Copy the following instructions into the Dockerfile:

FROM node:18-alpine ENV NODE_ENV=development WORKDIR /app COPY package.json . RUN apk add g++ make py3-pip RUN npm install COPY . . EXPOSE 3000 CMD [ "node", "server.js" ]

  1. In the terminal, navigate to the server directory and run the following command:

docker build -t server-image

This command will build the Docker image and tag it as "server-image".

  1. To run the container, use the following command:

docker run -p 3000:3000 server-image

Docker commands:

docker build -t name-of-image

docker run -p matchPort:matchPort name-of-image

business-contacts's People

Contributors

lindaeng avatar si-mv avatar stevenjlance avatar wallacepreston avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.