diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3514c27 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# Builder stage +FROM node:18.17.0 AS builder + +# Set working directory +WORKDIR /app + +# Install dependencies +COPY package*.json ./ +RUN npm install + +# Copy app source +COPY . . + +# Build the app +RUN npm run build + +# Runtime stage +FROM node:18.17.0-slim + +# Set working directory +WORKDIR /app + +# Copy built artifacts from the builder stage +COPY --from=builder /app/build /app/build +COPY --from=builder /app/node_modules /app/node_modules +COPY --from=builder /app/package.json /app/ +COPY --from=builder /app/bridge.mts /app/ +COPY --from=builder /app/app /app/app/ + +RUN apt-get update -y && apt-get install -y openssl + +RUN npm install -g npm@10.2.5 + +# Expose the port the app runs on +EXPOSE 3000 + +# Command to run the app +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5a30c79 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' +services: + app: + build: . + ports: + - "3000:3000" + volumes: + - ./data/app.db:/app/prisma/dev.db + bridge: + build: . + command: ["npm", "run", "bridge"] + volumes: + - ./data/app.db:/app/prisma/dev.db