feat: initial docker support
This commit is contained in:
parent
f083140006
commit
eb25182cb7
|
@ -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"]
|
|
@ -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
|
Loading…
Reference in New Issue