Fixing backend image
All checks were successful
Anatid Blog CI Workflow / test (./backend) (push) Successful in 30s
Anatid Blog CI Workflow / test (./frontend) (push) Successful in 32s
Anatid Blog CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/anatid-blog-backend, ./backend) (push) Successful in 51s
Anatid Blog CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/anatid-blog-frontend, ./frontend) (push) Successful in 45s
Anatid Blog CI Workflow / deploy (push) Successful in 13s

This commit is contained in:
Phill Pover 2025-03-27 12:46:23 +00:00
parent 12761802cf
commit cdaa6a1416
11 changed files with 515 additions and 86 deletions

View File

@ -1,14 +1,8 @@
# Build Stage
FROM node:23-alpine AS build
FROM node:23-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm install
COPY . .
# COPY .env .env.development ./
RUN npm run build
# Production Stage
FROM nginx:stable-alpine AS production
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD [ "node", "dist/main.js" ]

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,11 @@
"@nestjs/common": "^11.0.1",
"@nestjs/core": "^11.0.1",
"@nestjs/platform-express": "^11.0.1",
"@nestjs/typeorm": "^11.0.0",
"pg": "^8.14.1",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1"
"rxjs": "^7.8.1",
"typeorm": "^0.3.21"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",

View File

@ -1,9 +1,10 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PostsModule } from './posts/posts.module';
@Module({
imports: [],
imports: [PostsModule],
controllers: [AppController],
providers: [AppService],
})

View File

@ -3,6 +3,7 @@ import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();

View File

@ -0,0 +1,7 @@
export class Post {
id: number;
title: string;
uri: string;
body: string;
created: Date;
}

View File

@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { PostsController } from './posts.controller';
describe('PostsController', () => {
let controller: PostsController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [PostsController],
}).compile();
controller = module.get<PostsController>(PostsController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@ -0,0 +1,4 @@
import { Controller } from '@nestjs/common';
@Controller('posts')
export class PostsController {}

View File

@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { PostsController } from './posts.controller';
import { PostsService } from './posts.service';
@Module({
controllers: [PostsController],
providers: [PostsService]
})
export class PostsModule {}

View File

@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { PostsService } from './posts.service';
describe('PostsService', () => {
let service: PostsService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [PostsService],
}).compile();
service = module.get<PostsService>(PostsService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class PostsService {}