- Install Docker
- Make a file name Dockerfile
touch Dockerfile
FROM python:3.8-alpine
RUN apk add --no-cache python3-dev \
&& pip3 install --upgrade pip
WORKDIR /src
COPY . .
RUN pip install -r requirements.txt
EXPOSE 5000
ENTRYPOINT ["python3"]
CMD ["app.py"]
# base image
FROM node:12.13.0-alpine
# set working directory
WORKDIR /src
# add `/app/node_modules/.bin` to $PATH
ENV PATH /src/node_modules/.bin:$PATH
# install and cache app dependencies
COPY . .
RUN npm install --silent
RUN npm install react-scripts@3.1.1 -g --silent
# start app
CMD ["npm", "start"]
docker build -t name .
docker run --name name -d -p port:port name
or
docker run --name name -d -p port:port --network host name