mirror of
https://github.com/ershisan99/mlb-overlay-server.git
synced 2025-12-16 20:59:25 +00:00
add dockerfile
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
FROM oven/bun:1.2.15 as base
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json files for all workspaces
|
||||
COPY package.json bun.lock ./
|
||||
COPY apps/server/package.json ./apps/server/
|
||||
COPY apps/web/package.json ./apps/web/
|
||||
|
||||
# Install dependencies
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
# Copy the rest of the application
|
||||
COPY . .
|
||||
|
||||
# Build the server application
|
||||
RUN bun run build --filter server
|
||||
|
||||
# Expose ports for API and WebSocket servers
|
||||
EXPOSE 3000 4000
|
||||
|
||||
# Set environment variables
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Use a non-root user for better security
|
||||
USER bun
|
||||
|
||||
# Set the working directory to the server app
|
||||
WORKDIR /app/apps/server
|
||||
|
||||
# Start the server
|
||||
CMD ["bun", "run", "start"]
|
||||
Reference in New Issue
Block a user