Dockerfile for production server

This commit is contained in:
navaneeth 2021-07-31 10:10:19 +05:30
parent bee3a0f224
commit 62d8b3e646
3 changed files with 13 additions and 8 deletions

View file

@ -1,4 +1,4 @@
FROM ruby:2.7.3-buster
FROM node:14.17.0-buster
RUN apt update && apt install -y \
build-essential \
@ -8,11 +8,15 @@ RUN apt update && apt install -y \
RUN mkdir -p /app
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && RAILS_ENV=production bundle install --jobs 20 --retry 5
COPY ./server/package.json ./server/package-lock.json ./
RUN npm install
ENV RAILS_ENV=production
ENV NODE_ENV=development
COPY . ./
RUN ["chmod", "755", "docker/entrypoints/server.sh"]
ENTRYPOINT ["./docker/entrypoints/server.sh"]
COPY ./server/ ./
RUN npm run build
COPY ./docker/ ./docker/
RUN ["chmod", "755", "entrypoint.sh"]

1
server/.version Normal file
View file

@ -0,0 +1 @@
0.5.14

View file

@ -3,7 +3,7 @@ import { AppModule } from './app.module';
const fs = require('fs');
declare var TOOLJET_VERSION;
globalThis.TOOLJET_VERSION = fs.readFileSync('../.version', 'utf8')
globalThis.TOOLJET_VERSION = fs.readFileSync('./.version', 'utf8')
async function bootstrap() {
const app = await NestFactory.create(AppModule, {