-
Notifications
You must be signed in to change notification settings - Fork 57
feat: Add a Dockerfile for Bun server #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b64f2b8
Add a Dockerfile for Bun server
pei-mysten 82edf10
optimize
pei-mysten 76c5009
update
pei-mysten f014834
add comments
pei-mysten 2b3e155
use necessary args only
pei-mysten 0ce0634
move context out due to limit of kaniko
pei-mysten 2656dbd
Resolve gh fail: add license header to next-env.d.ts
Tzal3x 4508110
Ignore Dockerfile from .editorconfig
Tzal3x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
node_modules | ||
Dockerfile* | ||
docker-compose* | ||
.dockerignore | ||
.git | ||
.gitignore | ||
README.md | ||
LICENSE | ||
.vscode | ||
Makefile | ||
helm-charts | ||
.env | ||
.editorconfig | ||
.idea | ||
coverage* | ||
.next/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# use the official Bun image | ||
# see all versions at https://hub.docker.com/r/oven/bun/tags | ||
FROM oven/bun:1 AS base | ||
WORKDIR /usr/src/app | ||
|
||
# environment variables, can be overridden by docker build --build-arg <arg>=<value> | ||
ARG ENABLE_ALLOWLIST="false" | ||
ENV ENABLE_ALLOWLIST=${ENABLE_ALLOWLIST} | ||
|
||
ARG ENABLE_BLOCKLIST="false" | ||
ENV ENABLE_BLOCKLIST=${ENABLE_BLOCKLIST} | ||
|
||
ARG ENABLE_SENTRY="false" | ||
ENV ENABLE_SENTRY=${ENABLE_SENTRY} | ||
|
||
ARG LANDING_PAGE_OID_B36="41qecxqcyzqm8gl0cp2fqd6iq62j0jo5the39nb0bsg39acnib" | ||
ENV LANDING_PAGE_OID_B36=${LANDING_PAGE_OID_B36} | ||
|
||
ARG PORTAL_DOMAIN_NAME_LENGTH="21" | ||
ENV PORTAL_DOMAIN_NAME_LENGTH=${PORTAL_DOMAIN_NAME_LENGTH} | ||
|
||
ARG PREMIUM_RPC_URL_LIST="https://fullnode.testnet.sui.io" | ||
ENV PREMIUM_RPC_URL_LIST=${PREMIUM_RPC_URL_LIST} | ||
|
||
ARG RPC_URL_LIST="https://fullnode.testnet.sui.io,https://testnet.suiet.app" | ||
ENV RPC_URL_LIST=${RPC_URL_LIST} | ||
|
||
ARG SUINS_CLIENT_NETWORK="testnet" | ||
ENV SUINS_CLIENT_NETWORK=${SUINS_CLIENT_NETWORK} | ||
|
||
# install dependencies into temp directory | ||
# this will cache them and speed up future builds | ||
FROM base AS install | ||
RUN mkdir -p /temp/prod | ||
COPY portal/package.json portal/bun.lock /temp/prod/ | ||
COPY portal/common /temp/prod/common | ||
COPY portal/server /temp/prod/server | ||
COPY portal/worker /temp/prod/worker | ||
RUN cd /temp/prod && bun install --frozen-lockfile | ||
RUN cd /temp/prod && bun run build:server | ||
|
||
# copy production dependencies and source code into final image | ||
FROM base AS release | ||
COPY --from=install /temp/prod/node_modules node_modules | ||
COPY --from=install /temp/prod/package.json . | ||
COPY --from=install /temp/prod/server/package.json server/package.json | ||
COPY --from=install /temp/prod/server/.next server/.next | ||
|
||
# run the app | ||
USER bun | ||
EXPOSE 3000/tcp | ||
ENV NODE_ENV=production | ||
CMD [ "bun", "run", "server:prod" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.