-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from dgrebb/release/2.4.0
Release/2.4.0
- Loading branch information
Showing
15 changed files
with
722 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,46 @@ | ||
# -------- Base Node -------- # | ||
FROM node:18-alpine AS base | ||
# 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 | ||
RUN apk update && apk add --no-cache build-base \ | ||
gcc autoconf automake zlib-dev libpng-dev \ | ||
nasm bash vips-dev | ||
|
||
# -------- Dependencies -------- # | ||
FROM base AS dependencies | ||
COPY package*.json /tmp | ||
RUN cd /tmp && npm ci | ||
WORKDIR /opt/ | ||
COPY package*.json ./ | ||
COPY ./patches ./patches | ||
RUN npm ci --include=dev \ | ||
&& npm run postinstall --loglevel verbose \ | ||
&& npm cache clean --force | ||
|
||
# -------- Build -------- # | ||
FROM base AS build | ||
WORKDIR /opt/ | ||
COPY --from=dependencies /opt/node_modules ./node_modules | ||
ENV PATH /opt/node_modules/.bin:$PATH | ||
ARG NODE_ENV=production | ||
ENV NODE_ENV=${NODE_ENV} | ||
WORKDIR /opt/app | ||
COPY . . | ||
RUN npm run build | ||
|
||
# -------- Release -------- # | ||
FROM base AS release | ||
RUN mkdir -p /opt/app | ||
COPY --from=dependencies /tmp /opt/app/ | ||
FROM node:18-alpine | ||
RUN apk add --no-cache vips-dev | ||
WORKDIR /opt/ | ||
COPY --from=build /opt/node_modules ./node_modules | ||
WORKDIR /opt/app | ||
COPY ./ . | ||
ENV PATH /opt/app/node_modules/.bin:$PATH | ||
RUN strapi build | ||
COPY --from=build /opt/app ./ | ||
ENV PATH /opt/node_modules/.bin:$PATH | ||
|
||
# -------- Healthcheck -------- # | ||
HEALTHCHECK --interval=30s --timeout=60s --retries=3 \ | ||
CMD wget --no-verbose --tries=1 --spider http://localhost:1337/_health || exit 1 | ||
CMD wget --no-verbose --tries=1 --spider \ | ||
http://localhost:1337/_health || exit 1 | ||
|
||
# -------- Run -------- # | ||
RUN chown -R node:node /opt/app | ||
USER node | ||
EXPOSE 1337 | ||
CMD strapi start | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ run() { | |
docker run -p 1337:1337 -it ${back_img} | ||
} | ||
|
||
cdcms() { | ||
cdback() { | ||
cd ${directory}/../back | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
.cache | ||
.tmp | ||
build | ||
build | ||
public/uploads/* |
Oops, something went wrong.