-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 1.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
FROM node:20-alpine
# Update package list and install necessary packages
# Use dcron for cron, bash for scripts, procps-ng for pkill
RUN apk update && apk add --no-cache dcron bash procps-ng
WORKDIR /app
# Install pnpm globally
RUN npm install -g pnpm@8.4.0
# Copy package.json and pnpm-lock.yaml first for dependency caching
COPY package.json pnpm-lock.yaml ./
# Install project dependencies
RUN pnpm install --frozen-lockfile
# Copy the rest of the project files
COPY . .
# Ensure the data directory exists
RUN mkdir -p /app/public/data
# Copy the crontab file to the appropriate directory
COPY src/config/crontab-docker /etc/crontabs/root
# Apply the crontab
RUN crontab /etc/crontabs/root
# Copy the scripts and make them executable
COPY scripts/update_and_serve.sh /app/scripts/
COPY scripts/entrypoint.sh /app/scripts/
RUN chmod +x /app/scripts/update_and_serve.sh /app/scripts/entrypoint.sh
# Expose the port the application will run on
EXPOSE 3000
# Set the entrypoint to our custom script
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
# Remove the old CMD, as ENTRYPOINT handles the startup
# CMD ["pnpm", "dev"]