Skip to content

Commit

Permalink
Merge pull request #43 from choxx/jenkins_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ChakshuGautam authored Jan 6, 2023
2 parents 4db7007 + c59aa11 commit 5589f4a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function bootstrap() {

const port = process.env.PORT || 3333;
await app.startAllMicroservices();
await app.listen(port);
await app.listen(port, '0.0.0.0');
Logger.log(
`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`
);
Expand Down
27 changes: 27 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:16 AS builder

# Create app directory
WORKDIR /app

#RUN cp .env .env
RUN mkdir -p broker
RUN mkdir -p redisinsight
RUN chown -R 1001:1001 broker
RUN chown -R 1001:1001 redisinsight

COPY package.json ./
COPY yarn.lock ./

# Install app dependencies
RUN yarn install

COPY . .

RUN npx prisma generate --schema=./apps/api/src/app/prisma/schema.prisma

COPY . .

# Generate build
RUN yarn run build

CMD [ "npx", "nx", "serve", "api" ]
2 changes: 1 addition & 1 deletion build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ node() {
stage('docker-build') {
sh '''
# docker build -f <location-of-docker-file> -t <tag-of-docker-image> <context-for-docker-image>
docker build -f ./Dockerfile -t $docker_server/$docker_repo:$commit_id .
docker build -f ./build/Dockerfile -t $docker_server/$docker_repo:$commit_id .
'''
}

Expand Down

0 comments on commit 5589f4a

Please sign in to comment.