Skip to content

Commit

Permalink
ci(env): copy prod env to use by next build
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 19, 2024
1 parent f39312a commit e06d09f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM linkerry/base:latest AS builder
FROM registry.digitalocean.com/linkerry/base:latest AS builder

ARG NODE_ENV
ARG BUILD_FLAG
Expand Down
7 changes: 5 additions & 2 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# FROM linkerry/base:latest AS builder
FROM registry.digitalocean.com/linkerry/base:latest AS builder

ARG NODE_ENV
ARG BUILD_FLAG
ENV NEXT_TELEMETRY_DISABLED=true
ENV NEXT_PUBLIC_API_HOST=$NEXT_PUBLIC_API_HOST
RUN echo "API Host: $NEXT_PUBLIC_API_HOST"

WORKDIR /app/builder

# Copy the correct environment file based on the build argument `ENVIRONMENT`
# COPY .env.${ENVIRONMENT} ./.env
COPY /app/builder/apps/web/.env.prod /app/builder/apps/web/.env

RUN npx nx run web:build || echo "nx run web:build failed"

FROM node:lts-alpine AS runner
Expand Down
2 changes: 1 addition & 1 deletion docs/devops/ci.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build base docker image
`docker build . -t linkerry/base:latest`
`docker build . -t registry.digitalocean.com/linkerry/base:latest`

# build and run server docker compose
`docker compose -f ./apps/api-gateway/docker-compose.local.yml up -d`
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@linkerry/source",
"version": "0.0.0",
"packageManager": "pnpm@^8.0.0",
"packageManager": "pnpm@8.15.2",
"license": "MIT",
"private": true,
"author": {
Expand All @@ -21,8 +21,8 @@
"registry-and-publish": "sleep 3 && make publish-connectors & npx nx local-registry",
"ngrok": "ngrok http --domain=fairly-winning-chamois.ngrok-free.app 3001",
"stripe": "stripe listen --forward-to localhost:3001/api/v1/stripe/webhook",
"docker-base-linux": "docker build . -t linkerry/base:latest --platform=linux/amd64",
"docker-base": "docker build . -t linkerry/base:latest",
"docker-base-linux": "docker build . -t registry.digitalocean.com/linkerry/base:latest --platform=linux/amd64",
"docker-base": "docker build . -t registry.digitalocean.com/linkerry/base:latest",
"docker-api": "docker compose -f ./apps/api-gateway/docker-compose.local.yml up -d",
"docker-web": "docker compose -f ./apps/web/docker-compose.local.yml up -d"
},
Expand Down

0 comments on commit e06d09f

Please sign in to comment.