-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 1.02 KB
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
FROM node:20-slim
# Install required packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
postgresql-client \
netcat-openbsd \
bash \
wget \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /usr/src/app
# Use secure HTTPS registry (SSL verification enabled by default)
RUN npm config set registry https://registry.npmjs.org/
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
# Install dependencies
RUN npm install --legacy-peer-deps
# Bundle app source
COPY . .
# Build Tailwind CSS
RUN npm run build:css
# Copy and set permissions for entrypoint script
# Convert line endings from Windows (CRLF) to Unix (LF) if needed
COPY scripts/docker-entrypoint.sh /usr/local/bin/
RUN sed -i 's/\r$//' /usr/local/bin/docker-entrypoint.sh && \
chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 3000
# Use entrypoint script
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD [ "node", "index.js" ]