Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM node:20-alpine AS builder
# Stage 1: Build the static files
FROM node:22-alpine AS builder

WORKDIR /app

Expand All @@ -18,8 +19,18 @@ RUN npm install --legacy-peer-deps

COPY . .

# Build the Docusaurus project
RUN npm run build

# Stage 2: Serve the files using Nginx
FROM nginx:alpine

# Copy the static files from builder stage
# Docusaurus builds to the "build" directory by default
COPY --from=builder /app/build /usr/share/nginx/html

# Expose the application port
EXPOSE 3000
EXPOSE 80

# Start the application
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
recodehive:
build:
context: .
target: builder
ports:
- "3000:3000"
volumes:
Expand Down
Loading