Merge pull request #14034 from ToolJet/contributing-docker-fix

Fix no file error
This commit is contained in:
Adish M 2025-09-16 17:07:52 +05:30 committed by GitHub
commit ae7e7431b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 48 additions and 5 deletions

View file

@ -40,6 +40,8 @@ services:
platform: linux/x86_64
depends_on:
- postgres
env_file:
- .env
volumes:
- ./server:/app/server:delegated
- ./plugins:/app/plugins
@ -57,7 +59,7 @@ services:
container_name: postgrest
image: postgrest/postgrest:v12.0.2
ports:
- "3001:3000"
- "3002:3002"
env_file:
- .env
depends_on:

View file

@ -1,5 +1,5 @@
# pull official base image
FROM node:18.18.2-buster
FROM node:18.18.2-bullseye
ENV NODE_ENV=development

View file

@ -1,5 +1,5 @@
# pull official base image
FROM node:18.18.2-buster
FROM node:18.18.2-bullseye
RUN npm i -g npm@9.8.1

View file

@ -1,5 +1,5 @@
# pull official base image
FROM node:18.18.2-buster
FROM node:18.18.2-bullseye
RUN apt-get update && apt-get install -y postgresql-client freetds-dev libaio1 wget
# Install Instantclient Basic Light Oracle and Dependencies
@ -30,4 +30,4 @@ COPY ./server/package.json ./server/package-lock.json ./server/
RUN npm --prefix server install
COPY ./server/ ./server/
ENTRYPOINT ["./server/entrypoint.sh"]
ENTRYPOINT ["./server/local-ce-entrypoint.sh"]

View file

@ -55,6 +55,14 @@ chmod +x ./deploy/docker/internal.sh && ./deploy/docker/internal.sh
If you are setting up on a Windows machine, please ensure that the .env file line endings are set to LF, as they will be CRLF by default unless configured otherwise.
:::
Make sure to add these required envs along with the existing envs for PostgREST in your `.env` file:
```
PGRST_HOST=postgrest:3002
PGRST_SERVER_PORT=3002
PGRST_DB_PRE_CONFIG=postgrest.pre_config
```
5. Build Docker images.
```bash

33
server/local-ce-entrypoint.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/bash
set -e
if [ -f "./.env" ]; then
export $(grep -v '^#' ./.env | xargs -d '\n') || true
fi
if [ -d "./server/dist" ]; then
SETUP_CMD='npm run db:setup:prod'
else
SETUP_CMD='npm run db:setup'
fi
if [ -f "./.env" ]; then
declare $(grep -v '^#' ./.env | xargs)
fi
export NODE_OPTIONS="--max-old-space-size=4096 --experimental-global-webcrypto"
if [ -z "$DATABASE_URL" ]; then
./server/scripts/wait-for-it.sh $PG_HOST:${PG_PORT:-5432} --strict --timeout=300 -- $SETUP_CMD
else
PG_HOST=$(echo "$DATABASE_URL" | awk -F'[/:@?]' '{print $6}')
PG_PORT=$(echo "$DATABASE_URL" | awk -F'[/:@?]' '{print $7}')
if [ -z "$DATABASE_PORT" ]; then
DATABASE_PORT="5432"
fi
./server/scripts/wait-for-it.sh "$PG_HOST:$PG_PORT" --strict --timeout=300 -- $SETUP_CMD
fi
npm --prefix server run start:dev