mirror of
https://github.com/cerc-io/mars-interface.git
synced 2024-12-22 04:07:44 +00:00
feat: introduce Dockerfile
This Dockerfile produces a tiny image, 244Mi in size only. Heroku's buildpacks produces 3.74Gi in size. Signed-off-by: Andrey Arapov <andrey.arapov@nixaid.com>
This commit is contained in:
parent
41e2ee2e22
commit
45aa641b2c
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
.git
|
||||||
|
.github
|
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
FROM node:19-alpine as builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json yarn.lock ./
|
||||||
|
RUN yarn install
|
||||||
|
COPY . .
|
||||||
|
RUN apk --update add patch
|
||||||
|
RUN patch next.config.js next-config.patch
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
FROM node:19-alpine as runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
COPY --from=builder /app/package.json .
|
||||||
|
COPY --from=builder /app/yarn.lock .
|
||||||
|
COPY --from=builder /app/next.config.js .
|
||||||
|
COPY --from=builder /app/public ./public
|
||||||
|
COPY --from=builder /app/.next/standalone ./
|
||||||
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
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 Osmosis Outpost Frontend"
|
||||||
|
LABEL org.opencontainers.image.authors="andrey.arapov@nixaid.com"
|
||||||
|
LABEL org.opencontainers.image.source=https://github.com/mars-protocol/interface
|
16
next-config.patch
Normal file
16
next-config.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
diff --git a/next.config.js b/next.config.js
|
||||||
|
index 2801090..4b5fabe 100644
|
||||||
|
--- a/next.config.js
|
||||||
|
+++ b/next.config.js
|
||||||
|
@@ -48,6 +48,11 @@ const moduleExports = {
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
+ sentry: {
|
||||||
|
+ disableServerWebpackPlugin: true,
|
||||||
|
+ disableClientWebpackPlugin: true,
|
||||||
|
+ },
|
||||||
|
+ output: 'standalone'
|
||||||
|
}
|
||||||
|
|
||||||
|
const sentryWebpackPluginOptions = {
|
Loading…
Reference in New Issue
Block a user