-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Build stage | ||
FROM rust:1.81-bullseye AS builder | ||
|
||
# Install build dependencies including Node.js | ||
RUN apt-get update && apt-get install -y \ | ||
pkg-config \ | ||
libssl-dev \ | ||
build-essential \ | ||
curl \ | ||
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | ||
&& apt-get install -y nodejs \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a new empty shell project | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
|
||
# Build for release | ||
RUN cargo build --release | ||
|
||
# Final stage | ||
FROM debian:bullseye-slim | ||
|
||
# Install runtime dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
libssl1.1 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the build artifact from builder | ||
COPY --from=builder /usr/src/app/target/release/gridwalk-backend /usr/local/bin/gridwalk-backend | ||
|
||
# Set the startup command | ||
CMD ["gridwalk-backend"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use Node.js LTS version | ||
FROM --platform=linux/arm64 node:20-alpine | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm ci | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the Next.js application | ||
RUN npm run build | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3000 | ||
|
||
# Start the application | ||
CMD ["npm", "start"] |