Skip to content

Commit e8cd35e

Browse files
committed
updated entry point
1 parent f8bc13f commit e8cd35e

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

Dockerfile

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,21 @@ WORKDIR /app
66
COPY package.json /app
77
RUN npm install
88

9-
# Rebuild the source code only when needed
10-
FROM node:16-alpine AS builder
11-
WORKDIR /app
12-
COPY --from=deps /app/node_modules ./node_modules
13-
COPY . .
14-
RUN npm run build
15-
169
# Production image, copy all the files and run next
1710
FROM node:16-alpine AS runner
1811
WORKDIR /app
1912

13+
COPY --from=deps /app/node_modules ./node_modules
14+
2015
ENV NODE_ENV production
2116

22-
RUN addgroup -g 1001 -S nodejs
23-
RUN adduser -S nextjs -u 1001
17+
# RUN addgroup -g 1001 -S nodejs
18+
# RUN adduser -S nextjs -u 1001
2419

2520
# You only need to copy next.config.js if you are NOT using the default configuration
26-
COPY --from=builder /app/next.config.js ./
27-
COPY --from=builder /app/public ./public
28-
COPY --from=builder /app/package.json ./package.json
29-
30-
# Automatically leverage output traces to reduce image size
31-
# https://nextjs.org/docs/advanced-features/output-file-tracing
32-
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
33-
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
21+
COPY . .
22+
RUN npm run build
3423

35-
COPY ./scripts ./scripts
3624
COPY ./public/schema.json ./scripts/ingestion
3725

3826
ENV PYTHONUNBUFFERED=1
@@ -41,20 +29,18 @@ RUN apk add make automake gcc g++ subversion python3-dev
4129
RUN python3 -m ensurepip
4230
RUN pip3 install --no-cache --upgrade pip setuptools
4331
RUN pip3 install -r ./scripts/ingestion/requirements.txt
44-
USER nextjs
32+
# USER nextjs
4533

4634

47-
ENV NEXT_PUBLIC_DATA_API="https://maayanlab.cloud/sigcom-lincs/data-api"
48-
ENV NEXT_PUBLIC_METADATA_API="https://maayanlab.cloud/sigcom-lincs/metadata-api"
4935
ENV PREFIX=/
5036
ENV NEXT_PUBLIC_PREFIX=/
5137
ENV PORT=3000
5238
# Next.js collects completely anonymous telemetry data about general usage.
5339
# Learn more here: https://nextjs.org/telemetry
5440
# Uncomment the following line in case you want to disable telemetry.
5541

56-
COPY --chown=nextjs:nodejs ./entrypoint.sh ./entrypoint.sh
42+
# COPY --chown=nextjs:nodejs ./entrypoint.sh ./entrypoint.sh
5743
ENV NEXT_TELEMETRY_DISABLED 1
5844
# CMD ["node", "server.js"]
59-
RUN ["chmod", "+x", "./entrypoint.sh"]
45+
RUN set -x && chmod +x ./entrypoint.sh
6046
ENTRYPOINT ["./entrypoint.sh"]

entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
if [ $INGEST ]
44
then
55
cd scripts/ingestion
6-
python populate.py $CLEAN data
6+
python populate.py $OPTIONS
77
cd ../..
88
else
99
echo "skipping ingestion..."
1010
fi
1111
cd scripts/ingestion
1212
python indexing.py schema.json
1313
cd ../..
14-
node server.js
14+
npm run build
15+
npm start

0 commit comments

Comments
 (0)