mirror of
https://github.com/sp-tarkov/db-website.git
synced 2025-02-02 17:49:21 -05:00
34 lines
734 B
Docker
34 lines
734 B
Docker
FROM node:20.12-slim
|
|
|
|
# Update and install dependencies
|
|
RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Latest Bun
|
|
RUN curl -fsSL https://bun.sh/install | bash
|
|
ENV BUN_INSTALL="/root/.bun"
|
|
ENV PATH="$BUN_INSTALL/bin:$PATH"
|
|
|
|
# Set up working directory
|
|
WORKDIR /app
|
|
|
|
# Copy and build frontend
|
|
COPY frontend ./frontend
|
|
WORKDIR /app/frontend
|
|
RUN npm install
|
|
RUN npm run build:prod
|
|
|
|
# Move built frontend assets into backend public directory
|
|
WORKDIR /app
|
|
RUN mkdir -p ./api/public
|
|
RUN cp -r ./frontend/dist/* ./api/public/
|
|
|
|
# Copy and build backend
|
|
COPY api ./api
|
|
WORKDIR /app/api
|
|
RUN cp .env.example .env
|
|
RUN bun install
|
|
|
|
# Final setup
|
|
WORKDIR /app/api
|
|
EXPOSE 3001
|
|
CMD ["bun", "run", "start"] |