2024-03-30 21:39:38 +00:00
|
|
|
# Use this image as the platform to build the app
|
2025-04-25 14:19:07 +02:00
|
|
|
FROM node:22-alpine AS external-website
|
2024-03-30 21:39:38 +00:00
|
|
|
|
2025-06-05 23:29:39 -04:00
|
|
|
# Metadata labels for the AdventureLog image
|
|
|
|
LABEL maintainer="Sean Morley" \
|
2025-06-07 11:14:27 -04:00
|
|
|
version="v0.10.0" \
|
2025-06-05 23:29:39 -04:00
|
|
|
description="AdventureLog — the ultimate self-hosted travel companion." \
|
|
|
|
org.opencontainers.image.title="AdventureLog" \
|
|
|
|
org.opencontainers.image.description="AdventureLog is a self-hosted travel companion that helps you plan, track, and share your adventures." \
|
2025-06-07 11:14:27 -04:00
|
|
|
org.opencontainers.image.version="v0.10.0" \
|
2025-06-05 23:29:39 -04:00
|
|
|
org.opencontainers.image.authors="Sean Morley" \
|
|
|
|
org.opencontainers.image.url="https://raw.githubusercontent.com/seanmorley15/AdventureLog/refs/heads/main/brand/banner.png" \
|
|
|
|
org.opencontainers.image.source="https://github.com/seanmorley15/AdventureLog" \
|
|
|
|
org.opencontainers.image.vendor="Sean Morley" \
|
|
|
|
org.opencontainers.image.created="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
|
|
|
org.opencontainers.image.licenses="GPL-3.0"
|
2024-03-30 21:39:38 +00:00
|
|
|
|
|
|
|
# The WORKDIR instruction sets the working directory for everything that will happen next
|
2024-03-30 21:30:22 +00:00
|
|
|
WORKDIR /app
|
2024-03-30 21:39:38 +00:00
|
|
|
|
2025-06-05 23:29:39 -04:00
|
|
|
# Install pnpm globally first
|
|
|
|
RUN npm install -g pnpm
|
|
|
|
|
|
|
|
# Copy package files first for better Docker layer caching
|
|
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
|
|
|
|
|
|
# Clean install all node modules using pnpm with frozen lockfile
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
# Copy the rest of the application files
|
2024-03-30 21:30:22 +00:00
|
|
|
COPY . .
|
2024-03-30 21:39:38 +00:00
|
|
|
|
2024-07-08 11:44:39 -04:00
|
|
|
# Remove the development .env file if present
|
|
|
|
RUN rm -f .env
|
|
|
|
|
2024-03-30 21:39:38 +00:00
|
|
|
# Build SvelteKit app
|
2024-07-08 11:44:39 -04:00
|
|
|
RUN pnpm run build
|
2024-03-30 21:30:22 +00:00
|
|
|
|
2025-06-05 23:29:39 -04:00
|
|
|
# Make startup script executable
|
2024-04-02 14:41:07 +00:00
|
|
|
RUN chmod +x ./startup.sh
|
|
|
|
|
2025-06-05 23:29:39 -04:00
|
|
|
# Change to non-root user for security
|
2024-03-30 21:39:38 +00:00
|
|
|
USER node:node
|
|
|
|
|
2025-06-05 23:29:39 -04:00
|
|
|
# Expose the port that the app is listening on
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2024-04-02 14:41:07 +00:00
|
|
|
# Run startup.sh instead of the default command
|
2025-06-05 23:29:39 -04:00
|
|
|
CMD ["./startup.sh"]
|