mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 07:19:36 +02:00
This patch updates the Dockerfile to use Node.js 22 for running the frontend. Given that the security support of Node.js 18 ends in 6 days (30 Apr 2025), upgrading definitely makes sense. Additionally, this also seems to fix the broken JSON generated by the recently upgrraded version of @sveltejs/kit, thus fixing #584.
35 lines
827 B
Docker
35 lines
827 B
Docker
# Use this image as the platform to build the app
|
|
FROM node:22-alpine AS external-website
|
|
|
|
# A small line inside the image to show who made it
|
|
LABEL Developers="Sean Morley"
|
|
|
|
# The WORKDIR instruction sets the working directory for everything that will happen next
|
|
WORKDIR /app
|
|
|
|
# Copy all local files into the image
|
|
COPY . .
|
|
|
|
# Remove the development .env file if present
|
|
RUN rm -f .env
|
|
|
|
# Install pnpm
|
|
RUN npm install -g pnpm
|
|
|
|
# Clean install all node modules using pnpm
|
|
RUN pnpm install
|
|
|
|
# Build SvelteKit app
|
|
RUN pnpm run build
|
|
|
|
# Expose the port that the app is listening on
|
|
EXPOSE 3000
|
|
|
|
# Run the app
|
|
RUN chmod +x ./startup.sh
|
|
|
|
# The USER instruction sets the user name to use as the default user for the remainder of the current stage
|
|
USER node:node
|
|
|
|
# Run startup.sh instead of the default command
|
|
CMD ["./startup.sh"]
|