]> Untitled Git - lemmy-ui.git/blobdiff - dev.dockerfile
fix submodule error
[lemmy-ui.git] / dev.dockerfile
index 51bcd26cfa0a55ba97e09d2c478692ac7e0e2a83..881d9bc35f3e800e6dba154530cd9f2c6f05da71 100644 (file)
@@ -1,11 +1,15 @@
-FROM node:alpine as builder\r
+FROM node:20.2-alpine as builder\r
 RUN apk update && apk add curl yarn python3 build-base gcc wget git --no-cache\r
 \r
 WORKDIR /usr/src/app\r
 \r
+ENV npm_config_target_arch=x64\r
+ENV npm_config_target_platform=linux\r
+ENV npm_config_target_libc=musl\r
+\r
 # Cache deps\r
 COPY package.json yarn.lock ./\r
-RUN yarn install --ignore-scripts --prefer-offline --pure-lockfile\r
+RUN yarn --prefer-offline --pure-lockfile\r
 \r
 # Build\r
 COPY generate_translations.js \\r
@@ -16,11 +20,12 @@ COPY generate_translations.js \
 \r
 COPY lemmy-translations lemmy-translations\r
 COPY src src\r
+COPY .git .git\r
 \r
 # Set UI version \r
 RUN echo "export const VERSION = 'dev';" > "src/shared/version.ts"\r
 \r
-RUN yarn install --ignore-scripts --prefer-offline\r
+RUN yarn --prefer-offline\r
 RUN yarn build:dev\r
 \r
 FROM node:alpine as runner\r
@@ -29,4 +34,4 @@ COPY --from=builder /usr/src/app/node_modules /app/node_modules
 \r
 EXPOSE 1234\r
 WORKDIR /app\r
-CMD node dist/js/server.js\r
+CMD node dist/js/server.js
\ No newline at end of file