all repos — website @ ea0a1221938b48ec13381e6e118734c365598496

My official website.

Update Dockerfile
Michael Kinder michael@noreply.git.foggymtndrifter.com
Tue, 22 Oct 2024 13:24:10 -0400
commit

ea0a1221938b48ec13381e6e118734c365598496

parent

7966ee7ee2b5c74fe018200813ef2d649309b51c

1 files changed, 23 insertions(+), 6 deletions(-)

jump to
M DockerfileDockerfile

@@ -1,9 +1,26 @@

-FROM node:lts AS build -WORKDIR /app +# Stage 1: Build the Astro app +FROM node:18-alpine AS build + +WORKDIR /usr/src/app + +# Install dependencies +COPY package*.json ./ +RUN npm install + +# Copy the rest of the app COPY . . -RUN npm i + +# Build the Astro app RUN npm run build -FROM httpd:2.4 AS runtime -COPY --from=build /app/dist /usr/local/apache2/htdocs/ -EXPOSE 80+# Stage 2: Serve the app using nginx +FROM nginx:alpine + +# Copy built files to nginx's html directory +COPY --from=build /usr/src/app/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start nginx +CMD ["nginx", "-g", "daemon off;"]