👷 Build with a Dockerfile

This commit is contained in:
ChatonDeAru
2024-03-23 17:52:33 +01:00
parent e1dabf4f06
commit 772ae1c8b8
7 changed files with 3277 additions and 2276 deletions

36
Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
# App build
FROM node:20-alpine as build-stage
## Enable corepack for proper version of YARN
RUN corepack enable
WORKDIR /app
RUN apk add --no-cache \
libstdc++ \
build-base \
libtool \
autoconf \
automake \
elfutils-dev \
make \
cmake \
libcurl \
python3 \
nasm \
libjpeg-turbo-dev
ENV NODE_OPTIONS="--max_old_space_size=4096"
## Copy file for YARN then install all deps
COPY .yarnrc.yml yarn.lock* package.json ./
RUN yarn install --frozen-lockfile
COPY . .
## Build the app
RUN yarn run build
EXPOSE 8080
CMD ["yarn", "start"]