updated Dockerfile anddocker-compose.yml, along with README.md

This commit is contained in:
Dave Lane 2024-08-29 11:40:28 +12:00
parent 47531c5870
commit 05205b4ecb
3 changed files with 67 additions and 10 deletions

View file

@ -1,15 +1,26 @@
# Dockerfile
# Use this image as the platform to build the app
FROM node:20.11-alpine AS external-website
FROM node:16-alpine
RUN npm install -g pnpm
# A small line inside the image to show who made it
LABEL Developers="Dave Lane, dave@laneventures.nz"
# The WORKDIR instruction sets the working directory for everything that will happen next
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy all local files into the image
COPY . .
RUN pnpm build
EXPOSE 3000
CMD ["node", "build"]
# Clean install all node modules
RUN npm ci
# Build SvelteKit app
RUN npm run build
# Delete source code files that were used to build the app that are no longer needed
RUN rm -rf src/ static/ emailTemplates/ docker-compose.yml
# The USER instruction sets the user name to use as the default user for the remainder of the current stage
USER node:node
# This is the command that will be run inside the image when you tell Docker to start the container
CMD ["node","build/index.js"]