Skip to content

Commit

Permalink
chore: trying some env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Sep 16, 2024
1 parent e768da9 commit 69e5948
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# should be updated accordingly.

# General
NEXT_TELEMETRY_DISABLED="true"
NODE_ENV="development"
NEXT_PUBLIC_SITE_URL="http://localhost:3000"

Expand Down
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FROM base AS deps

WORKDIR /app

ENV NODE_ENV=production

# Install dependencies
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
Expand All @@ -15,10 +17,25 @@ WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Disable telemetry during the build
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV SKIP_ENV_VALIDATION=true

# Set environment variables during the build
ARG NEXT_PUBLIC_SITE_URL
ARG DATABASE_USER
ARG DATABASE_PASSWORD
ARG DATABASE_HOST
ARG DATABASE_PORT
ARG DATABASE_NAME

ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL
ENV DATABASE_USER=$DATABASE_USER
ENV DATABASE_PASSWORD=$DATABASE_PASSWORD
ENV DATABASE_HOST=$DATABASE_HOST
ENV DATABASE_PORT=$DATABASE_PORT
ENV DATABASE_NAME=$DATABASE_NAME

# Build the application
RUN bunx next build

Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_SITE_URL
- DATABASE_USER
- DATABASE_PASSWORD
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_NAME
ports:
- "3000:3000"
db:
Expand Down

0 comments on commit 69e5948

Please sign in to comment.