Skip to content

Commit a8c1ead

Browse files
committed
fix(docker): Proper setup docker build with env.local
Signed-off-by: Helio Chissini de Castro <[email protected]>
1 parent 48a5397 commit a8c1ead

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.github/workflows/docker_deploy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ jobs:
4545
echo "ORG_BASE_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
4646
echo "GIT_REVISION=$(git describe --abbrev=6 --always --tags --match=[0-9]*)" >> $GITHUB_ENV
4747
48+
- name: Set up Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: '22' # or your required version
52+
53+
- name: Run npx auth secret
54+
run: |
55+
cp docs/templates/template.env .env.local
56+
npx auth secret
57+
4858
- name: Set up Docker Buildx
4959
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
5060

Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ ARG NEXT_PUBLIC_SW360_API_URL
2424
ARG NEXTAUTH_URL
2525
ARG AUTH_SECRET
2626

27-
# export them as env vars so Next.js build can see them
28-
ENV NEXT_PUBLIC_SW360_API_URL=$NEXT_PUBLIC_SW360_API_URL
29-
ENV NEXTAUTH_URL=$NEXTAUTH_URL
30-
ENV AUTH_SECRET=$AUTH_SECRET
31-
32-
RUN pnpm install && pnpm build
27+
RUN pnpm install
28+
RUN pnpm build -d
3329

3430
# Runtime
3531
ARG VARIANT=22-slim

docs/templates/template.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_SW360_API_URL='http://localhost:8080'
2+
NEXT_AUTH_URL="http://localhost:3000"

0 commit comments

Comments
 (0)