-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 859 Bytes
/
Dockerfile
File metadata and controls
29 lines (19 loc) · 859 Bytes
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
FROM denoland/deno:2.2.3
WORKDIR /app
# Install OpenSSL for Prisma
RUN apt-get update -y && apt-get install -y openssl
# Copy configuration files first
COPY deno.json deno.lock ./
COPY prisma/ ./prisma/
# Generate Prisma client with script permissions
RUN deno run --allow-all --allow-scripts=npm:@prisma/engines@6.4.1,npm:prisma@6.4.1,npm:@prisma/client@6.4.1 npm:prisma@latest generate
# Copy the rest of the application code
COPY . .
# Cache the dependencies
RUN deno cache --reload main.ts
# Expose the port (Cloud Run injects PORT env var that the container should listen on)
EXPOSE ${PORT:-8443}
# Set up environment variable for Deno to allow scripts
ENV DENO_ALLOW_SCRIPTS=npm:@prisma/engines,npm:prisma,npm:@prisma/client
# First run Prisma migration, then start the application
CMD ["sh", "-c", "deno task prisma:push && deno task start"]