From 6ee7627ee975f5d566aac7713e2791756fb86096 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Thu, 3 Apr 2025 14:17:19 +1100 Subject: [PATCH] Initial work for adding a Dockerfile and creating an image for inspector Fixes #237 --- .dockerignore | 35 +++++++++++++++++++++++++++++++++++ Dockerfile | 26 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..a3e960e3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,35 @@ +# Version control +.git +.gitignore + +# Node.js +node_modules +npm-debug.log + +# Build artifacts +client/dist +client/build +server/dist +server/build + +# Environment variables +.env +.env.local +.env.development +.env.test +.env.production + +# Editor files +.vscode +.idea + +# Logs +logs +*.log + +# Testing +coverage + +# Docker +Dockerfile +.dockerignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2d318a33 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM node:22-slim + +# Set working directory +WORKDIR /app + +# Copy files +COPY . . + +# Install dependencies +# Working around https://github.com/npm/cli/issues/4828 +# RUN npm ci +RUN npm install --no-package-lock + +# Build the application +RUN npm run build + +ENV CLIENT_PORT=6274 +ENV SERVER_PORT=6277 + +# Expose the CLIENT_PORT and SERVER_PORT +EXPOSE $CLIENT_PORT +EXPOSE $SERVER_PORT + +# Use ENTRYPOINT with CMD for arguments +ENTRYPOINT ["npm", "start"] +CMD [] \ No newline at end of file