ndp / git-cheatsheet

Interactive cheatsheet, visualization of git.
http://ndpsoftware.com/git-cheatsheet.html
MIT License
331 stars 103 forks source link

dockerfile make it simple #56

Open DXShelley opened 3 weeks ago

DXShelley commented 3 weeks ago
FROM node:18-alpine AS base

FROM base AS deps

WORKDIR /app

COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn ./.yarn

# RUN yarn config set registry 'https://registry.npmmirror.com/' && yarn install
RUN yarn config set npmRegistryServer  'https://registry.npmmirror.com/' && yarn install

FROM base AS builder

WORKDIR /app

COPY . .
COPY --from=deps /app /app

RUN pwd && ls -al &&  yarn build

FROM base AS runner

WORKDIR /app

COPY --from=builder /app/* ./

EXPOSE 8080

CMD ["yarn", "start"]
DXShelley commented 3 weeks ago
  1. add Dockerfile in the root direcotry. edit this file with aforementioned.
  2. run docker build -t git-cheatsheet . command for making a docker image.
  3. run docker run -d -p 8082:8080 --name hellogit b047db957d7d command ,starting a web server with port 8082.
  4. browse http://localhost:8082 for exploring.