Base + compilacion simple

This commit is contained in:
2026-03-09 17:11:09 +01:00
parent 221abe0d33
commit 97f8c55199
22 changed files with 1006 additions and 32 deletions

View File

@@ -1,22 +1,24 @@
# Stage base para coordinar las fases de build y ejecucion
FROM node:22-alpine AS base
FROM node:22-alpine
# Hace falta para la herramienta de migraciones, cuando se publique se
# sustituira por el paquete de npm
RUN apk --no-cache add git=latest
WORKDIR /usr/local/app
COPY ./package.json ./package.lock ./
#RUN apk --no-cache add git
WORKDIR /app
COPY ./package.json ./package-lock.json ./
COPY ./src ./src
# copia el codigo en general
COPY tsconfig*.json ./
COPY tsconfig.json ./
COPY .env* ./
COPY ./.yarnrc.yml ./
COPY ./deployment/local/docker/start.sh ./
COPY ./deployment/local/start.sh ./
# Copiar el archivo de migrations? porque ahora no creo que se esté lanzando nada
COPY ./deployment/database/migrations ./deployment/database/migrations
RUN npm install --production && \
npm build && \
chmod +x start.sh
RUN npm config set registry https://git.savefamilygps.net/api/packages/SaveFamily/npm/ &&\
echo "registry=https://registry.npmjs.org/" >> .npmrc &&\
npm install &&\
ls && npm run build &&\
chmod +x start.sh
EXPOSE ${PORT}
ENTRYPOINT [ "./start.sh" ]

View File

@@ -6,8 +6,8 @@ networks:
services:
sf-nfc-api:
container_name: sf-nfc-api
image: sf-nfc-api
container_name: sf-nfc-server
image: sf-nfc-server
build:
context: ./
dockerfile: deployment/local/docker/Dockerfile.local
@@ -45,13 +45,13 @@ services:
env_file:
- .env
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
- "${POSTGRES_PORT}:5432"
volumes:
- ./sql-data/:/var/lib/postgres/data
- ./deployment/database/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
command: -p 5432

View File

@@ -1,3 +1,4 @@
#!/bin/sh
echo "Lanzando migraciones e iniciando servidor"
npm run migrate && npm run start
npm run build
npm run start