-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 912 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 912 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
29
30
31
32
# Use an official Node.js runtime as the base image
FROM node:16-bullseye-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends postgresql-client netcat-openbsd ca-certificates curl dos2unix \
&& rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package.json yarn.lock ./
# Install dependencies
RUN corepack enable && yarn install --frozen-lockfile
# Copy application code
COPY . .
# Normaliza CRLF/BOM e instala o entrypoint
RUN (dos2unix /app/entrypoint.sh || sed -i 's/\r$//' /app/entrypoint.sh) 2>/dev/null || true \
&& sed -i '1s/^\xEF\xBB\xBF//' /app/entrypoint.sh || true \
&& install -m 0755 /app/entrypoint.sh /usr/local/bin/entrypoint.sh
# Generate Prisma client
RUN npx prisma generate
# Expose a port (if your Node.js application needs it)
EXPOSE 3001 3333
# Set entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]