2021-01-04 10:44:06 -05:00
|
|
|
FROM node:14-alpine as builder
|
2021-01-04 10:56:37 -05:00
|
|
|
RUN apk update && apk add yarn python3 build-base gcc wget git --no-cache
|
2020-09-09 18:56:02 -05:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
# Cache deps
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install --pure-lockfile
|
|
|
|
|
2020-10-23 15:14:42 +03:00
|
|
|
# Build
|
2020-09-09 18:56:02 -05:00
|
|
|
COPY generate_translations.js \
|
|
|
|
tsconfig.json \
|
|
|
|
webpack.config.js \
|
|
|
|
.babelrc \
|
2020-10-23 15:14:42 +03:00
|
|
|
./
|
|
|
|
|
2020-09-10 14:49:33 -05:00
|
|
|
COPY lemmy-translations lemmy-translations
|
2020-09-09 18:56:02 -05:00
|
|
|
COPY src src
|
2021-04-26 09:57:41 -04:00
|
|
|
COPY .git .git
|
|
|
|
|
|
|
|
# Set UI version
|
|
|
|
RUN echo "export const VERSION = '$(git describe --tag)';" > "src/shared/version.ts"
|
2020-09-09 18:56:02 -05:00
|
|
|
|
2020-09-06 22:41:46 -05:00
|
|
|
RUN yarn
|
2020-09-10 11:39:01 -05:00
|
|
|
RUN yarn build:prod
|
2020-09-09 18:56:02 -05:00
|
|
|
|
|
|
|
FROM node:14-alpine as runner
|
|
|
|
COPY --from=builder /usr/src/app/dist /app/dist
|
|
|
|
COPY --from=builder /usr/src/app/node_modules /app/node_modules
|
|
|
|
|
2020-09-06 22:41:46 -05:00
|
|
|
EXPOSE 1234
|
2020-09-10 11:39:01 -05:00
|
|
|
WORKDIR /app
|
|
|
|
CMD node dist/js/server.js
|