Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.next
node_modules
.env*
Comment thread
lumburovskalina marked this conversation as resolved.
.cursor
.github
*.log
npm-debug.log*
dev.Dockerfile
.drone.yml
README.md
50 changes: 45 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ steps:
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
image: plugins/docker:21
environment:
BUILDX_NO_DEFAULT_ATTESTATIONS: "1"
depends_on:
- submodules
settings:
platform: linux/amd64
base_image_registry: dhi.io
base_image_username:
from_secret: dockerhub_username
base_image_password:
from_secret: dockerhub_password
registry: registry.dev.kern.ai
username:
from_secret: docker_username
Expand Down Expand Up @@ -75,8 +85,18 @@ steps:
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
image: plugins/docker:21
environment:
BUILDX_NO_DEFAULT_ATTESTATIONS: "1"
depends_on:
- submodules
settings:
platform: linux/arm64
base_image_registry: dhi.io
base_image_username:
from_secret: dockerhub_username
base_image_password:
from_secret: dockerhub_password
registry: registry.dev.kern.ai
username:
from_secret: docker_username
Expand Down Expand Up @@ -110,13 +130,23 @@ steps:
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
image: plugins/docker:21
environment:
BUILDX_NO_DEFAULT_ATTESTATIONS: "1"
depends_on:
- submodules
settings:
base_image_registry: dhi.io
base_image_username:
from_secret: dockerhub_username
base_image_password:
from_secret: dockerhub_password
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
repo: "kernai/${DRONE_REPO_NAME}"
platform: linux/amd64
tag: "${DRONE_TAG}-drone-amd64"

trigger:
Expand All @@ -139,13 +169,23 @@ steps:
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
image: plugins/docker:21
environment:
BUILDX_NO_DEFAULT_ATTESTATIONS: "1"
depends_on:
- submodules
settings:
base_image_registry: dhi.io
base_image_username:
from_secret: dockerhub_username
base_image_password:
from_secret: dockerhub_password
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
repo: "kernai/${DRONE_REPO_NAME}"
platform: linux/arm64
tag: "${DRONE_TAG}-drone-arm64"

trigger:
Expand Down Expand Up @@ -173,4 +213,4 @@ depends_on:

trigger:
event:
- tag
- tag
40 changes: 35 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
FROM node:18-alpine AS build
ARG DHI_NODE_BUILD=dhi.io/node:20-debian12-dev
ARG DHI_NODE_RUNTIME=dhi.io/node:20-debian12

FROM ${DHI_NODE_BUILD} AS builder

WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY . /app

COPY package*.json ./
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm install && npm cache clean --force

Comment thread
lumburovskalina marked this conversation as resolved.
COPY pages ./pages
COPY pkg ./pkg
COPY util ./util
COPY styles ./styles
COPY i18n ./i18n
COPY public ./public
COPY submodules ./submodules
COPY next.config.js .
COPY tsconfig.json .
COPY postcss.config.js .
COPY tailwind.config.js .

RUN npm run build

ENTRYPOINT ["/usr/local/bin/npm", "run", "start"]
FROM ${DHI_NODE_RUNTIME}

WORKDIR /app
Comment thread
lumburovskalina marked this conversation as resolved.

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

COPY --from=builder --chown=1000:1000 /app/.next/standalone ./
COPY --from=builder --chown=1000:1000 /app/public ./public
COPY --from=builder --chown=1000:1000 /app/.next/static ./.next/static

USER node

ENTRYPOINT ["node", "server.js"]
Comment thread
lumburovskalina marked this conversation as resolved.
8 changes: 6 additions & 2 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
FROM node:18-alpine
ARG PARENT_IMAGE=dhi.io/node:20-debian12-dev

FROM ${PARENT_IMAGE}

WORKDIR /app

VOLUME ["/app"]

USER root

COPY package*.json /app/

ENV NEXT_TELEMETRY_DISABLED=1
Expand All @@ -12,4 +16,4 @@ ENV WATCHPACK_POLLING=true

RUN npm install --include=dev

ENTRYPOINT ["/usr/local/bin/npm", "run", "dev"]
ENTRYPOINT ["/usr/local/bin/npm", "run", "dev"]
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
reactStrictMode: true,
swcMinify: true,
env: {
Expand Down
2 changes: 1 addition & 1 deletion submodules/javascript-functions
Loading