-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 826 Bytes
/
Dockerfile
File metadata and controls
30 lines (24 loc) · 826 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
# Use an official Node.js runtime as a parent image
FROM node:lts AS runtime
# Set the working directory in the container
WORKDIR /app
# Install dependencies and build the application
COPY . .
# Install git to allow Astro to fetch remote themes
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
# Clean up apt cache to reduce image size
RUN npm install
# Build the Astro application
RUN npm run build
# Set environment variables for the Astro dev server
ENV HOST=0.0.0.0
# Set the port for the Astro dev server
ENV PORT=4321
# Expose the port for the Astro dev server
EXPOSE 4321
# Start the Astro dev server
CMD ["node", "./dist/server/entry.mjs"]
# dev containerではpostCreateCommandでnpm installを実行するため、ここでは無限待機
CMD ["tail", "-f", "/dev/null"]