-
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.
Update dockerfile to produce a more specific prod image
- Loading branch information
Showing
7 changed files
with
12,487 additions
and
11,286 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,114 +1,4 @@ | ||
############################ | ||
# OS X | ||
############################ | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
Icon | ||
.Spotlight-V100 | ||
.Trashes | ||
._* | ||
|
||
|
||
############################ | ||
# Linux | ||
############################ | ||
|
||
*~ | ||
|
||
|
||
############################ | ||
# Windows | ||
############################ | ||
|
||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
|
||
############################ | ||
# Packages | ||
############################ | ||
|
||
*.7z | ||
*.csv | ||
*.dat | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.seed | ||
*.so | ||
*.swo | ||
*.swp | ||
*.swn | ||
*.swm | ||
*.out | ||
*.pid | ||
|
||
|
||
############################ | ||
# Logs and databases | ||
############################ | ||
|
||
.tmp | ||
*.log | ||
*.sql | ||
*.sqlite | ||
*.sqlite3 | ||
|
||
|
||
############################ | ||
# Misc. | ||
############################ | ||
|
||
*# | ||
ssl | ||
.idea | ||
nbproject | ||
public/uploads/* | ||
!public/uploads/.gitkeep | ||
|
||
############################ | ||
# Node.js | ||
############################ | ||
|
||
lib-cov | ||
lcov.info | ||
pids | ||
logs | ||
results | ||
node_modules | ||
.node_history | ||
|
||
############################ | ||
# Tests | ||
############################ | ||
|
||
coverage | ||
|
||
############################ | ||
# Strapi | ||
############################ | ||
|
||
.env | ||
license.txt | ||
exports | ||
.strapi | ||
dist | ||
build | ||
.strapi | ||
.strapi-updater.json |
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,18 +1,30 @@ | ||
FROM node:18-alpine | ||
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev git | ||
ARG NODE_ENV=production | ||
ENV NODE_ENV=${NODE_ENV} | ||
# -|---------------------------------------------------------------------------- | ||
# | Intermediate image for building the application. | ||
# -|---------------------------------------------------------------------------- | ||
FROM node:20-alpine AS builder | ||
WORKDIR /app | ||
|
||
WORKDIR /opt/ | ||
RUN npm install -g node-gyp | ||
COPY package.json package-lock.json ./ | ||
RUN npm install | ||
ENV PATH /opt/node_modules/.bin:$PATH | ||
RUN npm ci | ||
|
||
WORKDIR /opt/app | ||
COPY . . | ||
RUN chown -R node:node /opt/app | ||
USER node | ||
COPY tsconfig.json ./ | ||
COPY src ./src | ||
RUN npm run build | ||
|
||
# -|---------------------------------------------------------------------------- | ||
# | Final image containing only the files required to run in production. | ||
# -|---------------------------------------------------------------------------- | ||
FROM node:20-alpine AS production | ||
RUN apk add --no-cache vips-dev | ||
|
||
WORKDIR /app | ||
USER node | ||
ENV NODE_ENV=production | ||
|
||
COPY --from=builder --chown=node:node /app/package.json . | ||
COPY --from=builder --chown=node:node /app/dist dist | ||
COPY --from=builder --chown=node:node /app/node_modules node_modules | ||
COPY --chown=node:node public ./public | ||
|
||
EXPOSE 1337 | ||
CMD ["npm", "run", "start"] | ||
ENTRYPOINT [ "npm", "run", "start" ] |
Empty file.
Oops, something went wrong.