// Create one docker-compose.yml

// Folder structure => docker-compose.yml your-app  
version: "3.8"
services:
  client:
    container_name: frontend
    restart: always
    build: ./docker-compose.yml
    ports:
      - "3000:3000" # Expose the client on port 3000


cd your-app
touch Dockerfile

FROM node:alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm", "start" ]


---------
To run it
cd .. 

to run the docker file : docker-compose up -d//make a file called Docker 
FROM node:latest

//sets a folder
RUN mkdir -p /app/src

//sets working directory
WORKDIR /app/src

//copy the package
COPY package.json .

//runs npm install
RUN npm install

COPY . .

//exposes port 3000
EXPOSE 3000

//runs the comand npm start
CMD ["npm", "start"]# 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 react-scripts@3.4.1 -g --silent

# add app
COPY . ./

# start app
CMD ["npm", "start"]
# Stage 1 - Building image
FROM node:8.7.0-alpine as node

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

# Stage 2 - Running image
FROM bitnami/nginx:1.14.2

COPY --from=node /usr/src/app/build /var/www/my-app
COPY ./nginx.conf /opt/bitnami/nginx/conf/nginx.conf

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"npm install cors express mysql

Javascript相关代码片段

react toastify promise

make.com arrays

react flex

javascript object.fromentries

format json without quotes

wordpress page keeps reloading

nodelist javascript

angular refresh page after submit

unminify js

jquery class contains text

ajax to controller not mapping list of ints

pdf.js shortcode

js length of string

ng build prod not working

or truth table

js or symbol

Git - Ignore node_modules folder everywhere

.net and javascript date functions format

js element in viewport

object detection in react native

remove repeated elements in array javascript

useTransission react

custom cursor for react

react get blue outline on routing Links

get rid of blue button effect on react links

nextjs remote url image

react router v6 basic code

lua table to json online

download video from url javascript

jquery set max length input

JS not selecting the element

react native clock

shadcn toast not showing

express folder structure

audio element

javascript set display of elem to block

react phone number input

tailwind intellisense not working with react

cannot find name 'cy'

submit form react

footer react bootstrap

angular interview questions and answers

trigger alert if button is clicked

change query params

verify control code iban javascript

react-spring

Next JS solve the Hydration error

how can i set a new expo project

generate aes key

storage capacity on browser

nix flake Javascript projects

reset udemy course progress

zod Input file schema with shadcn

wordpress rest api print json pretty

extract string csv js

remove extra space string javascript

count letters in string javascript

exract string js

lazygit nvim

ex:javascript loop

js slice last element

Multiply a number with .17 and round up to .25

sweetalert 2

booking calendar js

process.env is kept

AnimationEvent has no function name specified!

jquery date picker wordpress enque

js check in view

settimeout event in input in javascript in react

node option size

docker react app

React Modal using Dialog

how to create dynamic object in javascript

how to create global variable in postman

javascript interview questions tricky

how to create workflow request in postman

mysql json_extract array

parse response body in postman

query param generator js

jest function async API