This commit is contained in:
31
.gitea/workflows/build.yml
Normal file
31
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: build-and-push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: gitea.interno.com
|
||||||
|
username: nucleo000
|
||||||
|
password: 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: docker build -t gitea.interno.com/nucleo000/planilla:${{ github.sha }} -t gitea.interno.com/nucleo000/planilla:latest ./nucleo-bot
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: |
|
||||||
|
docker push gitea.interno.com/nucleo000/planilla:${{ github.sha }}
|
||||||
|
docker push gitea.interno.com/nucleo000/planilla:latest
|
||||||
|
|
||||||
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Dockerfile actualizado
|
||||||
|
|
||||||
|
FROM node:23-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# 1) Copiás sólo package.json (y package-lock.json si existe) para aprovechar cache
|
||||||
|
COPY package.json package-lock.json* ./
|
||||||
|
RUN npm install --omit=dev
|
||||||
|
|
||||||
|
# 2) Copiás el resto del código (todos los .js y módulos separados)
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# 3) Variables y puerto
|
||||||
|
ENV PORT=4000
|
||||||
|
EXPOSE 4000
|
||||||
|
|
||||||
|
# 4) Arranque
|
||||||
|
CMD ["node", "index.js"]
|
||||||
11
index.js
Normal file
11
index.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
const http = require('http');
|
||||||
|
|
||||||
|
const server = http.createServer((req, res) => {
|
||||||
|
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||||
|
res.end('Hello World\n');
|
||||||
|
});
|
||||||
|
|
||||||
|
const PORT = 3000;
|
||||||
|
server.listen(PORT, () => {
|
||||||
|
console.log(`Servidor corriendo en http://localhost:${PORT}`);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user