2024-02-13 10:33:13 +00:00
|
|
|
FROM node:20-alpine as builder
|
2023-02-24 08:47:27 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-02-13 10:33:13 +00:00
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install
|
2023-02-24 08:47:27 +00:00
|
|
|
COPY . .
|
2024-02-13 10:33:13 +00:00
|
|
|
RUN apk --update add patch
|
|
|
|
RUN patch next.config.js next-config.patch
|
2024-02-15 09:49:14 +00:00
|
|
|
|
|
|
|
ENV NEXT_PUBLIC_NETWORK=mainnet
|
|
|
|
ENV NEXT_PUBLIC_OSMOSIS_RPC=APP_NEXT_OSMOSIS_RPC
|
|
|
|
ENV NEXT_PUBLIC_OSMOSIS_REST=APP_NEXT_OSMOSIS_REST
|
|
|
|
ENV NEXT_PUBLIC_WALLET_CONNECT_ID=APP_NEXT_WALLET_CONNECT_ID
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
2023-02-24 08:47:27 +00:00
|
|
|
RUN yarn build
|
|
|
|
|
2024-02-13 10:33:13 +00:00
|
|
|
FROM node:20-alpine as runner
|
2023-02-24 08:47:27 +00:00
|
|
|
WORKDIR /app
|
2024-02-15 09:49:14 +00:00
|
|
|
|
2024-02-13 10:33:13 +00:00
|
|
|
COPY --from=builder /app/package.json .
|
|
|
|
COPY --from=builder /app/yarn.lock .
|
|
|
|
COPY --from=builder /app/next.config.js .
|
2023-02-24 08:47:27 +00:00
|
|
|
COPY --from=builder /app/public ./public
|
2024-02-13 20:17:57 +00:00
|
|
|
COPY --from=builder /app/.next/standalone ./
|
2024-02-13 10:33:13 +00:00
|
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
|
|
COPY entrypoint.sh .
|
2023-02-24 08:47:27 +00:00
|
|
|
|
2024-02-13 10:33:13 +00:00
|
|
|
RUN apk add --no-cache --upgrade bash
|
|
|
|
RUN ["chmod", "+x", "./entrypoint.sh"]
|
|
|
|
ENTRYPOINT ["./entrypoint.sh"]
|
2023-02-24 08:47:27 +00:00
|
|
|
|
|
|
|
EXPOSE 3000
|
2024-02-13 10:33:13 +00:00
|
|
|
CMD ["node", "server.js"]
|
|
|
|
|
|
|
|
# Labels
|
|
|
|
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
|
|
|
|
LABEL org.opencontainers.image.title="mars-fe"
|
|
|
|
LABEL org.opencontainers.image.description="Mars Protocol Outpost Frontend"
|
|
|
|
LABEL org.opencontainers.image.authors="info@mars.foundation"
|
|
|
|
LABEL org.opencontainers.image.source=https://github.com/mars-protocol/mars-v2-frontend
|