From 8163e89dd9ae99f4e504b4866f9811b3cfb2ad09 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 13 Mar 2024 23:46:45 +0000 Subject: [PATCH] Added a Dockerfile --- Dockerfile | 28 +++++++++++++++++++ .../1.0.0/full_documentation.json | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b89254a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Creating multi-stage build for production +FROM node:18-alpine as build +RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git > /dev/null 2>&1 +ENV NODE_ENV=production + +WORKDIR /opt/ +COPY package.json yarn.lock ./ +RUN yarn global add node-gyp +RUN yarn config set network-timeout 600000 -g && yarn install --production +ENV PATH /opt/node_modules/.bin:$PATH +WORKDIR /opt/app +COPY . . +RUN yarn build + +# Creating final production image +FROM node:18-alpine +RUN apk add --no-cache vips-dev +ENV NODE_ENV=production +WORKDIR /opt/ +COPY --from=build /opt/node_modules ./node_modules +WORKDIR /opt/app +COPY --from=build /opt/app ./ +ENV PATH /opt/node_modules/.bin:$PATH + +RUN chown -R node:node /opt/app +USER node +EXPOSE 1337 +CMD ["yarn", "start"] \ No newline at end of file diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index 026d141..e22e763 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2024-03-13T18:17:43.784Z" + "x-generation-date": "2024-03-13T23:19:31.710Z" }, "x-strapi-config": { "path": "/documentation",