File size: 1,652 Bytes
80f70d4
29702bb
 
9f6bc56
830a73a
80f70d4
5bf3b64
 
2aeb153
80f70d4
2aeb153
 
80f70d4
2aeb153
80f70d4
 
e334420
80f70d4
 
7b64370
9f6bc56
80f70d4
 
7b64370
80f70d4
7b64370
80f70d4
2aeb153
71575e4
80f70d4
2aeb153
80f70d4
 
fe6976e
23f7d7c
 
80f70d4
fe6976e
 
80f70d4
 
29702bb
 
fe6976e
80f70d4
 
 
 
8d64c95
71575e4
2aeb153
7b64370
830a73a
7b64370
8d64c95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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"]