-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1 KB
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 1 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
42
43
44
# Use Node.js 20 Alpine for smaller image size
FROM node:20-alpine
# Install pnpm globally
RUN npm install -g pnpm@10.12.4
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install
# Copy source code
COPY . .
# Copy README.md to the app directory for documentation
COPY README.md /app/
# Set environment variable placeholders during build
# These will be replaced at runtime with actual values
ENV NEXT_PUBLIC_NAVIDROME_URL=NEXT_PUBLIC_NAVIDROME_URL
ENV NEXT_PUBLIC_NAVIDROME_USERNAME=NEXT_PUBLIC_NAVIDROME_USERNAME
ENV NEXT_PUBLIC_NAVIDROME_PASSWORD=NEXT_PUBLIC_NAVIDROME_PASSWORD
ENV NEXT_PUBLIC_COMMIT_SHA=docker-build
ENV PORT=3000
# Build the application
RUN pnpm build
# Copy entrypoint script
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
# Expose the port
EXPOSE $PORT
# Set entrypoint to replace env vars at runtime
ENTRYPOINT ["entrypoint.sh"]
# Start the application
CMD ["sh", "-c", "pnpm start -p $PORT"]