Add Docker build + GitHub Actions CI/CD (test -> build -> publish to GHCR)
This commit is contained in:
1 parent
3ba969dbf4
commit
20c3fb1c06
7 files changed
+208
-1
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Сначала зависимости — слой кешируется
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
|
||||
# Затем код
|
||||
COPY index.js ./
|
||||
COPY lib ./lib
|
||||
|
||||
# Нерут-пользователь
|
||||
RUN addgroup -S bot && adduser -S -D -G bot bot
|
||||
USER bot
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
Reference in new issue
Block a user