diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dc771de --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use the official Node.js image +FROM node:lts-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and pnpm-lock.yaml for installing dependencies +COPY package.json pnpm-lock.yaml ./ + +# Install pnpm +RUN npm install -g pnpm + +# Install project dependencies +RUN pnpm install --frozen-lockfile + +# Copy the rest of the application code +COPY . . + +# Build the application for production +RUN pnpm run build + +# Expose the port +EXPOSE 3000 + +# Command to run the application in production +CMD ["pnpm", "run", "start"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..533beec --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +services: + hckrnws: + container_name: hckrnws + build: + context: . + dockerfile: Dockerfile + image: hckrnws:latest + restart: unless-stopped + security_opt: + - no-new-privileges + ports: + - 3000:3000