joinlemmy-site/Dockerfile

73 lines
1.8 KiB
Text
Raw Permalink Normal View History

2021-11-11 20:10:58 +00:00
# Build the git includes for the docs
2024-10-14 23:03:42 +00:00
FROM alpine:3 AS docs_include
2022-09-14 17:19:53 +00:00
RUN apk add --no-cache git bash curl
WORKDIR /app
COPY lemmy-docs ./lemmy-docs
WORKDIR /app/lemmy-docs
RUN ./update-includes.sh
# Build the docs
2024-10-14 23:03:42 +00:00
FROM alpine:3 AS docs
WORKDIR /app
RUN wget -O mdbook.tar.gz https://github.com/rust-lang/mdBook/releases/download/v0.4.30/mdbook-v0.4.30-x86_64-unknown-linux-musl.tar.gz
RUN tar -xzf mdbook.tar.gz
COPY lemmy-docs ./lemmy-docs
RUN ./mdbook build lemmy-docs -d ../docs
# Build the typedoc API docs
FROM node:20-alpine AS api
WORKDIR /app
COPY lemmy-js-client lemmy-js-client
WORKDIR /app/lemmy-js-client
RUN corepack enable pnpm
RUN pnpm i
RUN pnpm run docs
# Build the isomorphic app
FROM node:20-alpine AS builder
RUN apk update && apk add python3 build-base gcc wget git curl --no-cache
New tailwind-based joinlemmy-site (#243) * Starting on new tailwind based joinlemmy-site. * Formatting fix. * Adding follow communities block. * Adding a few more blocks. * Finishing up blocks. * Adding a few more pages. * Adding apps page. * Almost done with donation page. * Adding most of instances page. * Trying to fix CI 1. * Adding navbar and footer. * Adding bottom spacer. * Finishing up more info modal. * Adding icons to main page. * Eruda only in development mode. * Finishing up main page, starting to work on recs. * Adding main images. * Adding images 2. * Starting to add filters. * Finishing up helper modal. * Adding topic icons. * Adding more instances. * Fixing recommended. * Forgot to add instance picker. * Adding world background image. * Adding alexandrite. * Adding funding goal block. * Fix dockerfile. * Upgrading deps. * Fixing package json. * Updating coders, sponsors. * Fixing mobile margins. * Fixing navbar auto-close when clicked. * Removing todo. * Removing some useless instance helper links. * Fixing news titling. * Addressing PR comments. * Updating instance stats. * Fixing class -> className * Fixing sm:max directives. * Make instance images links to their sites. * Use ubuntu font. * Addressing PR comments. * Adding a few more android apps. * Adding thunder and combustible apps. * Fixing z index. * Add a warning alert for closed source apps. * Adding MLMYM app. Fixes #213 * Fixing i18n key. * Adding QR codes for cryptos. Fixes #219 * Addressing PR comments. * Fixing news preview. * Adding registration mode to details modal. Fixes #153 * Filter out bot instances. * Using glide carousel. * Adding glide min css. * Adding donation platform fetching. Fixes #248 * Prettying glide css. * Change dev goal to 3 * Adding sign up button. * Minifying docker image. * Removing sortpack.
2023-10-31 13:31:03 +00:00
RUN curl -sf https://gobinaries.com/tj/node-prune | sh
RUN corepack enable pnpm
WORKDIR /app
# Cache deps
COPY package.json pnpm-lock.yaml ./
RUN pnpm i
# Build
COPY tsconfig.json \
webpack.config.js \
.babelrc \
generate_translations.mjs \
generate_rss_feed.mjs \
New tailwind-based joinlemmy-site (#243) * Starting on new tailwind based joinlemmy-site. * Formatting fix. * Adding follow communities block. * Adding a few more blocks. * Finishing up blocks. * Adding a few more pages. * Adding apps page. * Almost done with donation page. * Adding most of instances page. * Trying to fix CI 1. * Adding navbar and footer. * Adding bottom spacer. * Finishing up more info modal. * Adding icons to main page. * Eruda only in development mode. * Finishing up main page, starting to work on recs. * Adding main images. * Adding images 2. * Starting to add filters. * Finishing up helper modal. * Adding topic icons. * Adding more instances. * Fixing recommended. * Forgot to add instance picker. * Adding world background image. * Adding alexandrite. * Adding funding goal block. * Fix dockerfile. * Upgrading deps. * Fixing package json. * Updating coders, sponsors. * Fixing mobile margins. * Fixing navbar auto-close when clicked. * Removing todo. * Removing some useless instance helper links. * Fixing news titling. * Addressing PR comments. * Updating instance stats. * Fixing class -> className * Fixing sm:max directives. * Make instance images links to their sites. * Use ubuntu font. * Addressing PR comments. * Adding a few more android apps. * Adding thunder and combustible apps. * Fixing z index. * Add a warning alert for closed source apps. * Adding MLMYM app. Fixes #213 * Fixing i18n key. * Adding QR codes for cryptos. Fixes #219 * Addressing PR comments. * Fixing news preview. * Adding registration mode to details modal. Fixes #153 * Filter out bot instances. * Using glide carousel. * Adding glide min css. * Adding donation platform fetching. Fixes #248 * Prettying glide css. * Change dev goal to 3 * Adding sign up button. * Minifying docker image. * Removing sortpack.
2023-10-31 13:31:03 +00:00
tailwind.config.js \
./
2021-03-23 16:37:49 +00:00
COPY joinlemmy-translations joinlemmy-translations
2021-03-31 19:23:58 +00:00
COPY lemmy-translations lemmy-translations
COPY src src
# Copy the docs and API
COPY --from=docs /app/docs ./src/assets/docs
COPY --from=api /app/lemmy-js-client/docs ./src/assets/api
RUN pnpm i
RUN pnpm prebuild:prod
RUN pnpm build:prod
New tailwind-based joinlemmy-site (#243) * Starting on new tailwind based joinlemmy-site. * Formatting fix. * Adding follow communities block. * Adding a few more blocks. * Finishing up blocks. * Adding a few more pages. * Adding apps page. * Almost done with donation page. * Adding most of instances page. * Trying to fix CI 1. * Adding navbar and footer. * Adding bottom spacer. * Finishing up more info modal. * Adding icons to main page. * Eruda only in development mode. * Finishing up main page, starting to work on recs. * Adding main images. * Adding images 2. * Starting to add filters. * Finishing up helper modal. * Adding topic icons. * Adding more instances. * Fixing recommended. * Forgot to add instance picker. * Adding world background image. * Adding alexandrite. * Adding funding goal block. * Fix dockerfile. * Upgrading deps. * Fixing package json. * Updating coders, sponsors. * Fixing mobile margins. * Fixing navbar auto-close when clicked. * Removing todo. * Removing some useless instance helper links. * Fixing news titling. * Addressing PR comments. * Updating instance stats. * Fixing class -> className * Fixing sm:max directives. * Make instance images links to their sites. * Use ubuntu font. * Addressing PR comments. * Adding a few more android apps. * Adding thunder and combustible apps. * Fixing z index. * Add a warning alert for closed source apps. * Adding MLMYM app. Fixes #213 * Fixing i18n key. * Adding QR codes for cryptos. Fixes #219 * Addressing PR comments. * Fixing news preview. * Adding registration mode to details modal. Fixes #153 * Filter out bot instances. * Using glide carousel. * Adding glide min css. * Adding donation platform fetching. Fixes #248 * Prettying glide css. * Change dev goal to 3 * Adding sign up button. * Minifying docker image. * Removing sortpack.
2023-10-31 13:31:03 +00:00
# Prune the image
RUN node-prune ./node_modules
RUN rm -rf ./node_modules/import-sort-parser-typescript
RUN rm -rf ./node_modules/typescript
RUN rm -rf ./node_modules/npm
FROM node:20-alpine AS runner
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/node_modules /app/node_modules
EXPOSE 1234
WORKDIR /app
CMD node dist/js/server.js