Skip to content

Commit

Permalink
0.19.4 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ubergeek77 authored Jun 7, 2024
1 parent db9fcff commit 3b50791
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
11 changes: 5 additions & 6 deletions Dockerfile-backend
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.6
ARG RUST_VERSION=1.76
ARG RUST_VERSION=1.78
ARG CARGO_BUILD_FEATURES=default
ARG RUST_RELEASE_MODE=release

Expand Down Expand Up @@ -31,16 +31,15 @@ RUN --mount=type=cache,target=/lemmy/target set -ex; \
# Release build
RUN --mount=type=cache,target=/lemmy/target set -ex; \
if [ "${RUST_RELEASE_MODE}" = "release" ]; then \
echo "pub const VERSION: &str = \"$(git describe --tag)\";" > crates/utils/src/version.rs; \
[ -z "$USE_RELEASE_CACHE" ] && cargo clean --release; \
cargo clean --release; \
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \
fi

FROM ${RUNNER_IMAGE} AS runner-linux

# Federation needs CA certificates
RUN apt update && apt install -y libssl-dev libpq-dev ca-certificates
# Add system packages that are needed: federation needs CA certificates, curl can be used for healthchecks
RUN apt update && apt install -y libssl-dev libpq-dev ca-certificates curl

COPY --from=build --chmod=0755 /lemmy/lemmy_server /usr/local/bin

Expand All @@ -54,4 +53,4 @@ USER $UNAME

ENTRYPOINT ["lemmy_server"]
EXPOSE 8536
STOPSIGNAL SIGTERM
STOPSIGNAL SIGTERM
25 changes: 13 additions & 12 deletions Dockerfile-frontend
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM node:21-alpine as builder
FROM node:alpine as builder

# Added vips-dev and pkgconfig so that local vips is used instead of prebuilt
# Done for two reasons:
# - libvips binaries are not available for ARM32
# - It can break depending on the CPU (https://github.com/LemmyNet/lemmy-ui/issues/1566)
RUN apk update && apk upgrade && apk add --no-cache curl yarn python3 build-base gcc wget git vips-dev pkgconfig
RUN apk update && apk upgrade && apk add --no-cache curl python3 build-base gcc wget git vips-dev pkgconfig

# Enable corepack to use pnpm
RUN corepack enable

# Install node-gyp
RUN npm install -g node-gyp
Expand All @@ -15,10 +18,8 @@ ENV npm_config_target_platform=linux
ENV npm_config_target_libc=musl

# Cache deps
COPY package.json yarn.lock ./

RUN yarn --production --prefer-offline --pure-lockfile --network-timeout 100000

COPY package.json pnpm-lock.yaml ./
RUN pnpm i
# Build
COPY generate_translations.js \
tsconfig.json \
Expand All @@ -30,19 +31,19 @@ COPY lemmy-translations lemmy-translations
COPY src src
COPY .git .git

# Set UI version
# Set UI version
RUN echo "export const VERSION = '$(git describe --tag)';" > "src/shared/version.ts"
RUN echo "export const BUILD_DATE_ISO8601 = '$(date -u +"%Y-%m-%dT%H:%M:%SZ")';" > "src/shared/build-date.ts"

RUN yarn --production --prefer-offline --network-timeout 100000
RUN yarn build:prod
RUN pnpm i
RUN pnpm prebuild:prod
RUN pnpm build:prod

RUN rm -rf ./node_modules/import-sort-parser-typescript
RUN rm -rf ./node_modules/typescript
RUN rm -rf ./node_modules/npm

RUN du -sh ./node_modules/* | sort -nr | grep '\dM.*'

FROM node:21-alpine as runner
FROM node:alpine as runner
ENV NODE_ENV=production

RUN apk update && apk add --no-cache curl vips-cpp && rm -rf /var/cache/apk/*
Expand Down

0 comments on commit 3b50791

Please sign in to comment.