diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..b6f874b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm", + "features": { + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/Dockerfile b/Dockerfile index 21b783e..0ccbd6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine +FROM node:22-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 ARG NODE_ENV=development @@ -10,7 +10,7 @@ RUN yarn config set network-timeout 600000 -g && yarn install WORKDIR /opt/app COPY . . -ENV PATH /opt/node_modules/.bin:$PATH +ENV PATH=/opt/node_modules/.bin:$PATH RUN chown -R node:node /opt/app USER node RUN ["yarn", "build"] diff --git a/Dockerfile.prod b/Dockerfile.prod index a40d806..6994edf 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,5 +1,5 @@ # Creating multi-stage build for production -FROM node:20-alpine AS build +FROM node:22-alpine AS build 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} @@ -13,7 +13,7 @@ COPY . . RUN yarn build # Creating final production image -FROM node:20-alpine +FROM node:22-alpine RUN apk add --no-cache vips-dev ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} diff --git a/package.json b/package.json index 56272ac..3c11529 100644 --- a/package.json +++ b/package.json @@ -34,13 +34,9 @@ "uuid": "260e7c98-fa4d-4377-a8b3-a4b5241d9e8b" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=20.0.0 <=22.x.x", "npm": ">=6.0.0" }, "license": "MIT", - "volta": { - "node": "20.12.1", - "yarn": "1.22.22" - }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" }