Spaces:
Running
Running
| # Start with the official Bun image, which is based on Debian | |
| #FROM node:latest | |
| FROM oven/bun:1.0 | |
| #FROM valkey/valkey:8.1.3 | |
| # Switch to root user to install packages | |
| USER root | |
| # Step 1: Install prerequisites for adding a new repository | |
| RUN apt-get update && apt-get install -y curl gpg apt-transport-https | |
| # Step 2: Add the official Valkey repository GPG key and source list | |
| # RUN curl -fsSL https://packages.valkey.io/gpg/valkey-io-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/valkey-io-archive-keyring.gpg | |
| RUN echo "deb [signed-by=/usr/share/keyrings/valkey-io-archive-keyring.gpg] https://packages.valkey.io/deb bullseye main" | tee /etc/apt/sources.list.d/valkey-io.list | |
| RUN apt-get install -y curl | |
| # Step 3: Now update again and install everything | |
| # The package manager now knows where to find Valkey | |
| RUN apt-get update && apt-get install -y \ | |
| redis \ | |
| postgresql \ | |
| postgresql-client \ | |
| procps \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # RUN apt install valkey/valkey -y | |
| RUN echo "Done with installs" | |
| # --- The rest of the file is the same as before --- | |
| # Create a non-root user for the application itself | |
| RUN useradd -m -u 2000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy package files and install dependencies | |
| COPY --chown=user package.json bun.lockb* ./ | |
| RUN bun install | |
| #RUN npm install | |
| # Copy the rest of the application source and the startup script | |
| COPY --chown=user . /app | |
| # Make the startup script executable | |
| RUN chmod +x start.sh | |
| # Expose the port your application will run on | |
| EXPOSE 8000 | |
| # Set the command to our startup script | |
| CMD ["./start.sh"] |