Skip to content

Commit

Permalink
Merge main repo into fork (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocshawn authored Dec 20, 2024
1 parent f4bafdc commit 4b7b96e
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 100 deletions.
60 changes: 23 additions & 37 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,30 @@
# docker build -t gen3ff .
# docker run -p 3000:3000 -it gen3ff
# for Macbook silicon M1/m2 uncomment the following lines and comment quay.io/cdis/ubuntu:20.04:
#FROM arm64v8/ubuntu:20.04 as build

FROM quay.io/cdis/ubuntu:20.04 AS build

ARG NODE_VERSION=20

ARG BASE_PATH
ARG NEXT_PUBLIC_PORTAL_BASENAME
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
# Build stage
FROM node:20-slim AS builder

WORKDIR /gen3

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libssl1.1 \
libgnutls30 \
ca-certificates \
curl \
git \
gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs \
&& apt-get clean \
&& npm install -g [email protected]

RUN addgroup --system --gid 1001 nextjs && adduser --system --uid 1001 nextjs
COPY ./package.json ./package-lock.json ./next.config.js ./tsconfig.json ./.env.development ./tailwind.config.js ./postcss.config.js ./
RUN npm ci
COPY ./src ./src
COPY ./public ./public
COPY ./config ./config
RUN npm ci
RUN npm install \
"@swc/core" \
"@napi-rs/magic-string"
RUN npm run build
ENV PORT=80
CMD ["npm", "run", "start"]
COPY ./start.sh ./
RUN npm install @swc/core @napi-rs/magic-string && \
npm run build

# Production stage
FROM node:20-slim AS runner

WORKDIR /gen3
ENV PORT=3000

RUN addgroup --system --gid 1001 nextjs && \
adduser --system --uid 1001 nextjs

COPY --from=builder /gen3/config ./config
COPY --from=builder /gen3/public ./public
COPY --from=builder /gen3/.next/static ./.next/static

USER nextjs
ENV PORT=3000
CMD bash ./start.sh

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Image and Push to Quay / Build Image and Push

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Image and Push to Quay / Build Image and Push

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
127 changes: 65 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@mdx-js/loader": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"@next/mdx": "^14.2.15",
"cookies-next": "^4.1.1",
"cookies-next": "^4.3.0",
"idb": "^8.0.0",
"jsonpath-plus": "^10.2.0",
"react": "^18.2.0",
Expand Down
5 changes: 5 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e
echo "starting server"
npm run start

0 comments on commit 4b7b96e

Please sign in to comment.