diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 3487065a..be865fc4 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -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}` ); diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 00000000..b3941007 --- /dev/null +++ b/build/Dockerfile @@ -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" ] diff --git a/build/Jenkinsfile b/build/Jenkinsfile index fd8e661c..66d57fb6 100644 --- a/build/Jenkinsfile +++ b/build/Jenkinsfile @@ -17,7 +17,7 @@ node() { stage('docker-build') { sh ''' # docker build -f -t - docker build -f ./Dockerfile -t $docker_server/$docker_repo:$commit_id . + docker build -f ./build/Dockerfile -t $docker_server/$docker_repo:$commit_id . ''' }