Commit 8ee2afa6 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

commit

parent f160f157
Loading
Loading
Loading
Loading

backend/docker-compose.yml

deleted100644 → 0
+0 −11
Original line number Diff line number Diff line
version: '3.7'

services:
  api:
    build:
      context: .
      dockerfile: dockerfile
    command: npm start
    ports:
      - 3001:3000 # Map host port 3001 to container port 3000
      # - 9229:9229 # Map host port 9229 to container port 9229

backend/dockerfile

deleted100644 → 0
+0 −14
Original line number Diff line number Diff line
FROM node

WORKDIR /api

RUN apt-get update && \
    apt-get install -y wget gnupg && \
    wget -qO - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
    echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
    apt-get update && \
    apt-get install -y chromium

COPY . .

RUN npm install
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ dotenv.config();
export class ServerConstants {
  static PORT: number = process.env.SERVER_PORT ? parseInt(process.env.SERVER_PORT) : 3003;
  static IP: string = publicIp || 'http://localhost';
  static HOST: string = `http://${publicIp || 'localhost'}:${this.PORT}`;
  static HOST: string = `https://superb-amazement-production.up.railway.app`;
  static ROOT_PATH: string = join(__dirname, '..', '..');
  static ROOT_STATIC_PATH: string = join(__dirname, '..', '..', 'static');
}
+24 −0
Original line number Diff line number Diff line
@@ -4,6 +4,29 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ServerConstants } from './constants/server.contants';
import { ValidationPipe } from '@nestjs/common';
import * as dotenv from 'dotenv';
import * as fs from 'fs';
import * as path from 'path';

function printTree(dir, depth = 0) {
  // Lee el contenido del directorio
  const files = fs.readdirSync(dir);

  files.forEach((file) => {
    const filePath = path.join(dir, file);
    const stat = fs.statSync(filePath);

    // Ignora la carpeta node_modules
    if (file === 'node_modules') return;

    // Imprime la estructura con indentación
    console.log(' '.repeat(depth * 2) + '|-- ' + file);

    // Si es un directorio, lo recorre de forma recursiva
    if (stat.isDirectory()) {
      printTree(filePath, depth + 1);
    }
  });
}

async function bootstrap() {
  dotenv.config();
@@ -31,6 +54,7 @@ async function bootstrap() {
  SwaggerModule.setup('api', app, document);
  app.enableCors();
  await app.listen(ServerConstants.PORT);
  printTree('/app');
  console.log(`Application is running on: ${await app.getUrl()}`);
  console.log(`API documentation at: ${await app.getUrl()}/api`);
}
+4 −4

File changed.

Preview size limit exceeded, changes collapsed.

Loading