50 lines
1.4 KiB
Docker
50 lines
1.4 KiB
Docker
|
# FROM node:16-alpine as build
|
||
|
# # Installing libvips-dev for sharp Compatibility
|
||
|
# RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev > /dev/null 2>&1
|
||
|
# ARG NODE_ENV=production
|
||
|
# ENV NODE_ENV=${NODE_ENV}
|
||
|
# WORKDIR /opt/
|
||
|
# COPY ./package.json ./yarn.lock ./
|
||
|
# ENV PATH /opt/node_modules/.bin:$PATH
|
||
|
# RUN yarn config set network-timeout 600000 -g && yarn install --production
|
||
|
# WORKDIR /opt/app
|
||
|
# COPY ./ .
|
||
|
# RUN yarn build
|
||
|
# FROM node:16-alpine
|
||
|
# RUN apk add --no-cache vips-dev
|
||
|
|
||
|
# FROM node:16-alpine
|
||
|
# RUN apk add --no-cache vips-dev
|
||
|
# ARG NODE_ENV=production
|
||
|
# ENV NODE_ENV=${NODE_ENV}
|
||
|
# WORKDIR /opt/app
|
||
|
# COPY --from=build /opt/node_modules ./node_modules
|
||
|
# ENV PATH /opt/node_modules/.bin:$PATH
|
||
|
# COPY --from=build /opt/app ./
|
||
|
# EXPOSE 5555
|
||
|
# CMD ["yarn", "start"]
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
# # following is from the strapi website
|
||
|
FROM node:18-alpine
|
||
|
# Installing libvips-dev for sharp Compatibility
|
||
|
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev git
|
||
|
ARG NODE_ENV=development
|
||
|
ENV NODE_ENV=${NODE_ENV}
|
||
|
|
||
|
WORKDIR /opt/
|
||
|
COPY package.json yarn.lock ./
|
||
|
RUN yarn global add node-gyp
|
||
|
RUN yarn config set network-timeout 600000 -g && yarn install
|
||
|
ENV PATH /opt/node_modules/.bin:$PATH
|
||
|
|
||
|
WORKDIR /opt/app
|
||
|
COPY . .
|
||
|
RUN chown -R node:node /opt/app
|
||
|
USER node
|
||
|
RUN ["yarn", "build"]
|
||
|
EXPOSE 1337
|
||
|
CMD ["yarn", "dev"]
|