Skip to content

Commit 71dae44

Browse files
committed
chore(ci): improve dockerfile
1 parent 1c0a1b6 commit 71dae44

File tree

5 files changed

+49
-238
lines changed

5 files changed

+49
-238
lines changed

.github/actions/setup-environment/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99

1010
- name: 🗂️ Cache asdf
1111
id: cache-asdf
12-
uses: actions/cache@v3
12+
uses: actions/cache@v4
1313
env:
1414
cache-name: cache-asdf
1515
cache-path: ~/.asdf
@@ -26,7 +26,7 @@ runs:
2626

2727
- name: 🗂️ Cache node_modules
2828
id: cache-node-modules
29-
uses: actions/cache@v3
29+
uses: actions/cache@v4
3030
env:
3131
cache-name: cache-node-modules
3232
cache-path: node_modules

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 20.10.0
1+
nodejs 20.11.1

docker/Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# syntax=docker/dockerfile:1.6-labs
22

3-
ARG NODE_VERSION=20
3+
ARG NODE_VERSION=20.11.1
44

5-
FROM node:${NODE_VERSION}-buster-slim as base
5+
FROM node:${NODE_VERSION}-alpine as base
66

77
LABEL maintainer="Borja Paz Rodríguez <borjapazr@gmail.com>" \
88
version="2.7.1" \
@@ -19,12 +19,13 @@ ARG WAIT_VERSION=2.12.1
1919

2020
RUN <<EOF
2121
set -ex
22-
apt-get update
23-
apt-get upgrade -y
24-
apt-get install -y openssl
25-
apt-get autoremove -y
26-
apt-get clean -y
27-
rm -rf /var/lib/apt/lists/*
22+
apk update
23+
apk upgrade
24+
apk add --no-cache openssl
25+
rm -rf /var/cache/apk/*
26+
EOF
27+
28+
RUN <<EOF
2829
npm install -g pm2
2930
npm cache clean --force
3031
EOF
@@ -52,7 +53,7 @@ COPY --link . .
5253
RUN <<EOF
5354
npm run prisma:generate
5455
npm run build
55-
npm prune --production
56+
npm prune --omit=dev
5657
EOF
5758

5859

package-lock.json

Lines changed: 33 additions & 223 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
],
2828
"scripts": {
2929
"dev": "cross-env NODE_ENV=development nodemon",
30-
"build": "run-s build:*",
30+
"build": "run-p build:*",
3131
"build:compile": "rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --silent",
32-
"build:assets": "copyfiles --error -f package*.json dist/",
32+
"build:assets": "copyfiles --error -f package*.json dist/ && copyfiles -u 1 --error */**/*.prisma dist/",
3333
"start": "cross-env NODE_ENV=production npm run build && node ./dist/index.js",
3434
"check:types": "tsc --pretty --noEmit",
3535
"check:format": "prettier --check .",
@@ -186,7 +186,7 @@
186186
"npm-check-updates": "^16.14.15",
187187
"npm-package-json-lint": "^7.1.0",
188188
"npm-package-json-lint-config-default": "^6.0.0",
189-
"npm-run-all": "^4.1.5",
189+
"npm-run-all2": "^6.1.2",
190190
"prettier": "^3.2.5",
191191
"prettier-plugin-packagejson": "^2.4.12",
192192
"prettier-plugin-prisma": "^5.0.0",

0 commit comments

Comments
 (0)