Skip to content

Commit

Permalink
Fix Env Argument (#11)
Browse files Browse the repository at this point in the history
* Update Dockerfile

* Update Dockerfile
  • Loading branch information
xyzuan authored Nov 5, 2024
1 parent 2babcc9 commit 2c4936a
Showing 1 changed file with 20 additions and 40 deletions.
60 changes: 20 additions & 40 deletions misc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@ FROM oven/bun:slim AS build

WORKDIR /app

ARG PORT
ARG NODE_ENV
ARG BASE_URL
ARG DOMAIN
ARG PASSWORD_PEPPER
ARG DATABASE_URL

ARG GOOGLE_CLIENT_ID
ARG GOOGLE_CLIENT_SECRET
ARG GITHUB_CLIENT_ID
ARG GITHUB_CLIENT_SECRET
ARG LINKEDIN_CLIENT_ID
ARG LINKEDIN_CLIENT_SECRET
ARG TELEGRAM_TOKEN
ARG TELEGRAM_CHAT_ID

ARG CLOUDINARY_CLOUD_NAME
ARG CLOUDINARY_API_KEY
ARG CLOUDINARY_API_SECRET

COPY package.json bun.lockb tsconfig.json ./
RUN \
if [ -f bun.lockb ]; then bun install --frozen-lockfile; \
Expand All @@ -31,26 +11,6 @@ RUN \
COPY ./src ./src
COPY ./prisma ./prisma

ENV PORT=$PORT
ENV NODE_ENV=$NODE_ENV
ENV BASE_URL=$BASE_URL
ENV DOMAIN=$DOMAIN
ENV PASSWORD_PEPPER=$PASSWORD_PEPPER
ENV DATABASE_URL=$DATABASE_URL

ENV GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID
ENV GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET
ENV GITHUB_CLIENT_ID=$GITHUB_CLIENT_ID
ENV GITHUB_CLIENT_SECRET=$GITHUB_CLIENT_SECRET
ENV LINKEDIN_CLIENT_ID=$LINKEDIN_CLIENT_ID
ENV LINKEDIN_CLIENT_SECRET=$LINKEDIN_CLIENT_SECRET
ENV TELEGRAM_TOKEN=$TELEGRAM_TOKEN
ENV TELEGRAM_CHAT_ID=$TELEGRAM_CHAT_ID

ENV CLOUDINARY_CLOUD_NAME=$CLOUDINARY_CLOUD_NAME
ENV CLOUDINARY_API_KEY=$CLOUDINARY_API_KEY
ENV CLOUDINARY_API_SECRET=$CLOUDINARY_API_SECRET

RUN bunx prisma generate
RUN bun build \
--compile \
Expand All @@ -68,6 +28,26 @@ COPY --from=build /app/server server
COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma
COPY --from=build /app/node_modules/@prisma /app/node_modules/@prisma

ARG PORT
ARG NODE_ENV
ARG BASE_URL
ARG DOMAIN
ARG PASSWORD_PEPPER
ARG DATABASE_URL

ARG GOOGLE_CLIENT_ID
ARG GOOGLE_CLIENT_SECRET
ARG GITHUB_CLIENT_ID
ARG GITHUB_CLIENT_SECRET
ARG LINKEDIN_CLIENT_ID
ARG LINKEDIN_CLIENT_SECRET
ARG TELEGRAM_TOKEN
ARG TELEGRAM_CHAT_ID

ARG CLOUDINARY_CLOUD_NAME
ARG CLOUDINARY_API_KEY
ARG CLOUDINARY_API_SECRET

ENV PORT=$PORT
ENV NODE_ENV=$NODE_ENV
ENV BASE_URL=$BASE_URL
Expand Down

0 comments on commit 2c4936a

Please sign in to comment.