Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.16.0
FROM --platform=linux/amd64 node:18.16.0

# Create app directory
WORKDIR /usr/src/app
Expand Down
25 changes: 25 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: experiment-hub-backend-deployment
labels:
app: experiment-hub-backend
spec:
replicas: 1
selector:
matchLabels:
app: experiment-hub-backend
template:
metadata:
labels:
app: experiment-hub-backend
spec:
containers:
- name: experiment-hub-backend
image: experiment-hub-backend:v0.1.0
imagePullPolicy: IfNotPresent
env:
- name: PORT
value: "3000"
ports:
- containerPort: 3000
16 changes: 16 additions & 0 deletions k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: experiment-hub-backend-ingress
spec:
rules:
- host: localhost
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: experiment-hub-backend-service
port:
number: 80
11 changes: 11 additions & 0 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: experiment-hub-backend-service
spec:
selector:
app: experiment-hub-backend
ports:
- protocol: TCP
port: 80
targetPort: 3000
172 changes: 96 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^3.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"reflect-metadata": "^0.1.13",
Expand Down Expand Up @@ -73,4 +74,4 @@
"^@app/auth(|/.*)$": "<rootDir>/libs/auth/src/$1"
}
}
}
}
3 changes: 2 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from '@app/auth';
import { ConfigModule } from '@nestjs/config';

@Module({
imports: [AuthModule],
imports: [AuthModule, ConfigModule.forRoot()],
controllers: [AppController],
providers: [AppService],
})
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { AppModule } from './app.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
await app.listen(process.env.PORT);
}
bootstrap();