42 lines
1.1 KiB
Docker
42 lines
1.1 KiB
Docker
# Use an official Bun image as the base
|
|
FROM oven/bun:1.3-debian
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Set environment variable to skip Chromium download
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
|
|
# Install git and Python
|
|
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create a symlink for python3 as python
|
|
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
|
|
|
# Copy package.json and bun.lockb to the container
|
|
# COPY package*.json ./
|
|
COPY /src/Managing.WebApp/package.json ./
|
|
|
|
# Install dependencies with bun
|
|
RUN bun install
|
|
RUN bun add -g tailwindcss postcss autoprefixer @tailwindcss/typography
|
|
|
|
# Copy the rest of the app's source code to the container
|
|
# COPY . .
|
|
COPY src/Managing.WebApp/ /app/
|
|
RUN bun --bun ./node_modules/.bin/vite build
|
|
|
|
# Build the app
|
|
RUN bun run build
|
|
|
|
# Use NGINX as the web server
|
|
FROM nginx:alpine
|
|
|
|
# Copy the built app to the NGINX web server directory
|
|
COPY --from=0 /app/build /usr/share/nginx/html
|
|
|
|
# Expose port 80 for the NGINX web server
|
|
EXPOSE 80
|
|
|
|
# Start the NGINX web server
|
|
CMD ["nginx", "-g", "daemon off;"] |