Answers for "react express docker"

3

docker react

# pull official base image
FROM node:13.12.0-alpine

# set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install --silent
RUN npm install [email protected] -g --silent

# add app
COPY . ./

# start app
CMD ["npm", "start"]
Posted by: Guest on December-04-2020
0

react js docker

version: '3'

services:
  backend:
    env_file:
        "./backend/backend.env"
    build:
      context: ./backend
      dockerfile: ./Dockerfile
    image: "dmurphy1217/twitter-sentiment-backend"
    ports:
      - "5000:5000"
  frontend:
    build:
      context: ./client
      dockerfile: ./Dockerfile
    image: "dmurphy1217/twitter-sentiment-frontend"
    ports:
      - "3000:3000"
    links:
      - "backend:be"
Posted by: Guest on May-21-2021
0

express react docker container example

# Use a lighter version of Node as a parent imageFROM mhart/alpine-node:8.11.4# Set the working directory to /clientWORKDIR /client# copy package.json into the container at /clientCOPY package*.json /client/# install dependenciesRUN npm install# Copy the current directory contents into the container at /clientCOPY . /client/# Make port 3000 available to the world outside this containerEXPOSE 3000# Run the app when the container launchesCMD ["npm", "start"]
Posted by: Guest on April-19-2021

Browse Popular Code Answers by Language