File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ services:
4040 platform : linux/x86_64
4141 depends_on :
4242 - postgres
43+ env_file :
44+ - .env
4345 volumes :
4446 - ./server:/app/server:delegated
4547 - ./plugins:/app/plugins
@@ -57,7 +59,7 @@ services:
5759 container_name : postgrest
5860 image : postgrest/postgrest:v12.0.2
5961 ports :
60- - " 3001:3000 "
62+ - " 3002:3002 "
6163 env_file :
6264 - .env
6365 depends_on :
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ if [ -f "./.env" ]; then
1515 declare $( grep -v ' ^#' ./.env | xargs)
1616fi
1717
18- export NODE_OPTIONS=" --max-old-space-size=4096 --experimental-global-webcrypto"
19-
2018if [ -z " $DATABASE_URL " ]; then
2119 ./server/scripts/wait-for-it.sh $PG_HOST :${PG_PORT:- 5432} --strict --timeout=300 -- $SETUP_CMD
2220else
3028 ./server/scripts/wait-for-it.sh " $PG_HOST :$PG_PORT " --strict --timeout=300 -- $SETUP_CMD
3129fi
3230
33-
34- npm --prefix server run start:dev
35-
31+ exec " $@ "
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ COPY ./package.json ./package.json
2727
2828# install app dependencies
2929COPY ./server/package.json ./server/package-lock.json ./server/
30- COPY ./docker/ce-entrypoint.sh ./docker/ce-entrypoint.sh
3130RUN npm --prefix server install
3231COPY ./server/ ./server/
3332
34- ENTRYPOINT ["./docker /ce-entrypoint.sh"]
33+ ENTRYPOINT ["./server /ce-entrypoint.sh"]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ if [ -f " ./.env" ]; then
5+ export $( grep -v ' ^#' ./.env | xargs -d ' \n' ) || true
6+ fi
7+
8+ if [ -d " ./server/dist" ]; then
9+ SETUP_CMD=' npm run db:setup:prod'
10+ else
11+ SETUP_CMD=' npm run db:setup'
12+ fi
13+
14+ if [ -f " ./.env" ]; then
15+ declare $( grep -v ' ^#' ./.env | xargs)
16+ fi
17+
18+ export NODE_OPTIONS=" --max-old-space-size=4096 --experimental-global-webcrypto"
19+
20+ if [ -z " $DATABASE_URL " ]; then
21+ ./server/scripts/wait-for-it.sh $PG_HOST :${PG_PORT:- 5432} --strict --timeout=300 -- $SETUP_CMD
22+ else
23+ PG_HOST=$( echo " $DATABASE_URL " | awk -F' [/:@?]' ' {print $6}' )
24+ PG_PORT=$( echo " $DATABASE_URL " | awk -F' [/:@?]' ' {print $7}' )
25+
26+ if [ -z " $DATABASE_PORT " ]; then
27+ DATABASE_PORT=" 5432"
28+ fi
29+
30+ ./server/scripts/wait-for-it.sh " $PG_HOST :$PG_PORT " --strict --timeout=300 -- $SETUP_CMD
31+ fi
32+
33+ npm --prefix server run start:dev
You can’t perform that action at this time.
0 commit comments