diff --git a/.dockerignore b/.dockerignore index cbd3e8a..44c994f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,3 +9,5 @@ !tsconfig.json !vite.config.ts !yarn.lock +!.yarnrc.yml +!.yarn \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 974e5e1..3c6e39f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM node:18-alpine3.17 as base +ARG NODE_IMAGE_NAME=20-alpine3.18 + +FROM node:${NODE_IMAGE_NAME} as base COPY . ./code WORKDIR /code @@ -10,23 +12,25 @@ RUN yarn build # Set up database RUN yarn prisma generate -FROM node:18-alpine3.17 as module-installation +FROM node:${NODE_IMAGE_NAME} as module-installation COPY package.json ./code/package.json COPY yarn.lock ./code/yarn.lock +COPY .yarnrc.yml ./code/.yarnrc.yml +COPY .yarn ./code/.yarn WORKDIR /code # Install production dependencies -RUN apk add --no-cache jq +RUN apk add --no-cache jq RUN jq 'del(.devDependencies)' package.json > package.json.temp && mv package.json.temp package.json -RUN yarn install --production --no-optional +RUN yarn install # Copy database client data COPY --from=base ./code/node_modules/@prisma ./node_modules/@prisma COPY --from=base ./code/node_modules/.prisma ./node_modules/.prisma COPY --from=base ./code/node_modules/prisma ./node_modules/prisma -FROM node:18-alpine3.17 as final +FROM node:${NODE_IMAGE_NAME} as final RUN apk add curl diff --git a/Makefile b/Makefile index 6ddeb18..6fdf82d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ fetch-dev-db: - docker pull postgres && docker tag postgres dev-db:latest + docker pull postgres:15 && docker tag postgres:15 dev-db:latest start-dev-db: docker run --name dev-db -e POSTGRES_PASSWORD=password --hostname docker --network qwik-network -d -v $(shell pwd)/database:/var/lib/postgresql/data dev-db remove-dev-db: diff --git a/package.json b/package.json index a43c358..3f0ef58 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "@types/express": "4.17.17", "@types/node": "^18.11.16", "@types/node-fetch": "latest", - "@typescript-eslint/eslint-plugin": "7.7.0", - "@typescript-eslint/parser": "7.7.0", + "@typescript-eslint/eslint-plugin": "6.21.0", + "@typescript-eslint/parser": "6.21.0", "compression": "^1.7.4", "eslint": "8.30.0", "eslint-plugin-qwik": "0.16.1", diff --git a/yarn.lock b/yarn.lock index d5c87b8..bdb47c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5995,7 +5995,7 @@ __metadata: languageName: node linkType: hard -"sharp@npm:^0.33.1": +"sharp@npm:^0.33.1, sharp@npm:^0.33.3": version: 0.33.3 resolution: "sharp@npm:0.33.3" dependencies: @@ -6828,6 +6828,7 @@ __metadata: prettier: "npm:2.8.1" preview-email: "npm:^3.0.7" prisma: "npm:^4.15.0" + sharp: "npm:^0.33.3" typescript: "npm:5.4.5" undici: "npm:5.19.1" util: "npm:^0.12.5"