@@ -21,7 +21,7 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc turbo.json ./
21
21
COPY agent ./agent
22
22
COPY packages ./packages
23
23
COPY scripts ./scripts
24
- COPY characters ./ characters
24
+ # Don't copy characters folder as we'll get it from GCS
25
25
26
26
# Install dependencies and build the project
27
27
RUN pnpm install \
@@ -31,10 +31,14 @@ RUN pnpm install \
31
31
# Create a new stage for the final image
32
32
FROM node:23.3.0-slim
33
33
34
- # Install runtime dependencies if needed
34
+ # Install runtime dependencies and Google Cloud SDK
35
35
RUN npm install -g pnpm@9.4.0 && \
36
36
apt-get update && \
37
- apt-get install -y git python3 && \
37
+ apt-get install -y git python3 curl gnupg && \
38
+ echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
39
+ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
40
+ apt-get update && \
41
+ apt-get install -y google-cloud-sdk && \
38
42
apt-get clean && \
39
43
rm -rf /var/lib/apt/lists/*
40
44
@@ -49,7 +53,16 @@ COPY --from=builder /app/node_modules ./node_modules
49
53
COPY --from=builder /app/agent ./agent
50
54
COPY --from=builder /app/packages ./packages
51
55
COPY --from=builder /app/scripts ./scripts
52
- COPY --from=builder /app/characters ./characters
53
56
54
- # Set the command to run the application
55
- CMD ["pnpm" , "start" , "--non-interactive" ]
57
+ # Create characters directory
58
+ RUN mkdir -p characters
59
+
60
+ # Set default environment variables
61
+ ENV PORT=8080
62
+ ENV SERVER_PORT=8080
63
+
64
+ # Expose the port
65
+ EXPOSE 8080
66
+
67
+ # Modified command to fetch character file from GCS before starting
68
+ CMD sh -c "gsutil cp gs://$BUCKET_NAME/$CHARACTER_FILE characters/character.json && pnpm start --non-interactive --characters=characters/character.json"
0 commit comments