Skip to content

Commit

Permalink
feat: add dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
zerj9 committed Nov 11, 2024
1 parent 82a4a7a commit c09ef6d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
34 changes: 34 additions & 0 deletions gridwalk-backend/Dockerfile
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"]
23 changes: 23 additions & 0 deletions gridwalk-ui/Dockerfile
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"]

0 comments on commit c09ef6d

Please sign in to comment.