2022-02-03 20:42:27 +00:00
|
|
|
FROM ubuntu:20.04 AS development
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
git-core \
|
|
|
|
iputils-ping \
|
|
|
|
pkg-config \
|
|
|
|
rsync \
|
|
|
|
software-properties-common \
|
|
|
|
unzip \
|
2022-02-05 07:33:08 +00:00
|
|
|
wget \
|
|
|
|
ffmpeg
|
2022-02-03 20:42:27 +00:00
|
|
|
|
|
|
|
# Install NodeJS
|
|
|
|
RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
|
|
|
|
RUN apt-get install --yes nodejs
|
|
|
|
|
|
|
|
RUN npm i -g yarn
|
|
|
|
|
|
|
|
RUN yarn install
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN yarn build
|
|
|
|
|
2022-02-03 21:27:31 +00:00
|
|
|
# Clean up commands
|
|
|
|
RUN apt-get autoremove -y && apt-get clean && \
|
|
|
|
rm -rf /usr/local/src/*
|
|
|
|
|
|
|
|
RUN apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2022-02-03 20:42:27 +00:00
|
|
|
|
|
|
|
FROM ubuntu:20.04 as production
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG NODE_ENV=production
|
|
|
|
ENV NODE_ENV=${NODE_ENV}
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
git-core \
|
|
|
|
iputils-ping \
|
|
|
|
pkg-config \
|
|
|
|
rsync \
|
|
|
|
software-properties-common \
|
|
|
|
unzip \
|
2022-02-05 07:33:08 +00:00
|
|
|
wget \
|
|
|
|
ffmpeg
|
2022-02-03 20:42:27 +00:00
|
|
|
|
|
|
|
# Install NodeJS
|
|
|
|
RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
|
|
|
|
RUN apt-get install --yes nodejs
|
|
|
|
|
|
|
|
RUN npm i -g yarn
|
|
|
|
|
|
|
|
RUN yarn install --only=production
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
COPY --from=development /usr/src/app/dist ./dist
|
|
|
|
|
2022-02-03 21:27:31 +00:00
|
|
|
# Clean up commands
|
|
|
|
RUN apt-get autoremove -y && apt-get clean && \
|
|
|
|
rm -rf /usr/local/src/*
|
|
|
|
|
|
|
|
RUN apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2022-02-03 20:42:27 +00:00
|
|
|
CMD ["node", "dist/main"]
|