-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1940 from ever-co/develop
chore: docker file build with correct env vars
- Loading branch information
Showing
4 changed files
with
73 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,9 +1,29 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Adjust NODE_VERSION as desired | ||
# Ever Teams Platform | ||
|
||
ARG NODE_VERSION=18.17.1 | ||
ARG NEXT_PUBLIC_GAUZY_API_SERVER_URL=https://api.gauzy.co | ||
ARG NEXT_PUBLIC_GA_MEASUREMENT_ID | ||
ARG NEXT_PUBLIC_CAPTCHA_SITE_KEY | ||
ARG NEXT_PUBLIC_DISABLE_AUTO_REFRESH=false | ||
ARG NEXT_PUBLIC_COOKIE_DOMAINS=ever.team | ||
ARG NEXT_PUBLIC_BOARD_APP_DOMAIN=https://board.ever.team | ||
ARG NEXT_PUBLIC_BOARD_BACKEND_POST_URL=https://jsonboard.ever.team/api/v2/post/ | ||
ARG NEXT_PUBLIC_BOARD_FIREBASE_CONFIG | ||
ARG NEXT_PUBLIC_MEET_DOMAIN=https://meet.ever.team | ||
ARG NEXT_PUBLIC_SENTRY_DSN | ||
ARG NEXT_PUBLIC_SENTRY_DEBUG | ||
ARG NEXT_PUBLIC_JITSU_BROWSER_URL | ||
ARG NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY | ||
ARG NEXT_PUBLIC_GITHUB_APP_NAME=ever-github | ||
ARG NEXT_PUBLIC_CHATWOOT_API_KEY | ||
|
||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL org.opencontainers.image.source https://github.com/ever-co/ever-teams | ||
|
||
# Next.js app lives here | ||
WORKDIR /app | ||
|
||
|
@@ -14,17 +34,33 @@ ENV NEXT_SHARP_PATH=/temp/node_modules/sharp | |
RUN npm i -g npm@latest | ||
# Install sharp, NextJS image optimization | ||
RUN mkdir /temp && cd /temp && \ | ||
npm i sharp | ||
npm i sharp | ||
|
||
RUN npm cache clean --force | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as build | ||
|
||
# We make env vars passed as build argument to be available in this build stage because we prebuild the NextJs app | ||
ARG NEXT_PUBLIC_GAUZY_API_SERVER_URL | ||
ARG NEXT_PUBLIC_GA_MEASUREMENT_ID | ||
ARG NEXT_PUBLIC_CAPTCHA_SITE_KEY | ||
ARG NEXT_PUBLIC_DISABLE_AUTO_REFRESH | ||
ARG NEXT_PUBLIC_COOKIE_DOMAINS | ||
ARG NEXT_PUBLIC_BOARD_APP_DOMAIN | ||
ARG NEXT_PUBLIC_BOARD_BACKEND_POST_URL | ||
ARG NEXT_PUBLIC_BOARD_FIREBASE_CONFIG | ||
ARG NEXT_PUBLIC_MEET_DOMAIN | ||
ARG NEXT_PUBLIC_SENTRY_DSN | ||
ARG NEXT_PUBLIC_SENTRY_DEBUG | ||
ARG NEXT_PUBLIC_JITSU_BROWSER_URL | ||
ARG NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY | ||
ARG NEXT_PUBLIC_GITHUB_APP_NAME | ||
ARG NEXT_PUBLIC_CHATWOOT_API_KEY | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install -y build-essential pkg-config python-is-python3 | ||
apt-get install -y build-essential pkg-config python-is-python3 | ||
|
||
# Install Yarn | ||
RUN npm install -g yarn --force | ||
|
@@ -35,7 +71,7 @@ COPY yarn.lock ./ | |
COPY apps/web/package.json ./apps/web/package.json | ||
|
||
RUN cd apps/web && \ | ||
yarn install --ignore-scripts | ||
yarn install --ignore-scripts | ||
|
||
# Copy application code | ||
COPY . . | ||
|
@@ -47,7 +83,7 @@ RUN yarn run build:web | |
|
||
# Remove development dependencies | ||
RUN cd apps/web && \ | ||
yarn install --prod --ignore-scripts | ||
yarn install --prod --ignore-scripts | ||
|
||
RUN yarn cache clean | ||
|
||
|
This file contains 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