Update Dockefile, .prettierignore and .eslintignore to make the build image launch the simple hello world app.
This commit is contained in:
parent
68ff272228
commit
6dcf82580a
|
@ -1,2 +1,7 @@
|
|||
/archetypes
|
||||
/assets
|
||||
/content
|
||||
/layouts
|
||||
/static
|
||||
/dist
|
||||
node_modules
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
/content
|
||||
/layouts
|
||||
/static
|
||||
/dist
|
||||
node_modules
|
||||
|
|
33
Dockerfile
33
Dockerfile
|
@ -1,8 +1,8 @@
|
|||
# Create a builder step.
|
||||
FROM ubuntu:20.04 as builder
|
||||
# Create a site builder step.
|
||||
FROM ubuntu:20.04 as site-builder
|
||||
|
||||
# Set the working directory.
|
||||
WORKDIR /app-builder
|
||||
WORKDIR /site-builder
|
||||
|
||||
# Install package dependencies.
|
||||
RUN apt-get update && apt-get install -y wget git build-essential
|
||||
|
@ -16,17 +16,36 @@ ENV GOBIN="/usr/local/go/bin"
|
|||
# Build and install Hugo.
|
||||
RUN CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
|
||||
|
||||
# Copy the source code.
|
||||
# Copy the site source code.
|
||||
COPY . .
|
||||
|
||||
# Build the site.
|
||||
RUN hugo --minify
|
||||
|
||||
# Create the final step.
|
||||
# Create the app builder step.
|
||||
FROM node:21.3.0-bookworm as app-builder
|
||||
|
||||
# Set the working directory.
|
||||
WORKDIR /app-builder
|
||||
|
||||
# Copy the project source code.
|
||||
COPY . .
|
||||
|
||||
# Install dependencies for building the project.
|
||||
RUN npm ci
|
||||
|
||||
# Build the project for production.
|
||||
RUN npm run build
|
||||
|
||||
# Create the app step.
|
||||
FROM node:21.3.0-bookworm as app
|
||||
|
||||
# Set the working directory.
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built site from builder step.
|
||||
COPY --from=builder /app-builder/public /app/public
|
||||
# Copy built project to the app image.
|
||||
COPY --from=app-builder /app-builder/dist /app
|
||||
COPY --from=app-builder /app-builder/node_modules /app/node_modules
|
||||
|
||||
# Run the app.
|
||||
CMD ["node", "main.js"]
|
||||
|
|
Loading…
Reference in a new issue