Skip to content

Commit 5460b97

Browse files
add docker-file
1 parent aa39025 commit 5460b97

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,20 @@ RUN apt-get update && apt-get install -y \
5454
xdg-utils \
5555
&& rm -rf /var/lib/apt/lists/*
5656

57-
# Install prod deps
57+
# Set working directory
58+
WORKDIR /app
59+
60+
# Install production dependencies
5861
COPY package.json package-lock.json* ./
5962
RUN npm ci --omit=dev
6063

64+
# Copy the dist folder
65+
COPY dist/ ./dist/
66+
67+
# Create symlink for server public folder at expected path
68+
RUN mkdir -p /app/liascript-exporter/server && \
69+
ln -s /app/dist/server/public /app/liascript-exporter/server/public
70+
6171
# Install Puppeteer's Chrome explicitly
6272
RUN npx puppeteer browsers install chrome
6373

@@ -67,12 +77,10 @@ RUN CHROME_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)
6777
echo "Chrome installed at: $CHROME_PATH" && \
6878
chmod +x /etc/profile.d/puppeteer.sh
6979

70-
COPY dist/ liascript-exporter/
71-
7280
# Create entrypoint script that sources the environment
7381
RUN echo '#!/bin/sh\n\
7482
export PUPPETEER_EXECUTABLE_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)\n\
75-
exec node liascript-exporter/index.js "$@"' > /entrypoint.sh && \
83+
exec node /app/dist/index.js "$@"' > /entrypoint.sh && \
7684
chmod +x /entrypoint.sh
7785

7886
EXPOSE 4000

0 commit comments

Comments
 (0)