Skip to content

Commit

Permalink
Sensible dockerfile, document env
Browse files Browse the repository at this point in the history
  • Loading branch information
prasannavl committed Jan 4, 2025
1 parent 5632925 commit 1110284
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12,535 deletions.
33 changes: 16 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
FROM node:18-alpine AS base

# Set the working directory inside the container
WORKDIR /app

# Copy the package files to the working directory
COPY package.json pnpm-lock.yaml /app/
COPY package.json .
COPY package-lock.json .
RUN npm install --include=dev

# Install PNPM globally
RUN npm install -g pnpm
COPY . .

# Install project dependencies using PNPM
RUN pnpm install --ignore-scripts puppeteer
# To check why lossless-json is not installed by jellyfishsdk
RUN pnpm install [email protected]
ENV NODE_ENV=production
# Note: Make sure to set these in the next-config.js file for the client as well
# or will have CSP errors
ENV NEXT_PUBLIC_RPC_CLIENT_ENDPOINT=https://ocean.defichain.com/v0/mainnet/rpc
ENV NEXT_PUBLIC_API_CLIENT_ENDPOINT=https//ocean.defichain.com

# Copy the rest of the application code
COPY . .
# For HTTP testing only
# ENV NODE_TLS_REJECT_UNAUTHORIZED=0

# Build the Next.js application
RUN pnpm run build
# export NEXT_PUBLIC_RPC_CLIENT_ENDPOINT=https://ocean.defichain.com/v0/mainnet/rpc
# export NEXT_PUBLIC_API_CLIENT_ENDPOINT=https://ocean.defichain.com

# Expose the port on which the application will run
EXPOSE 3000
RUN npm run build

# Start the Next.js application
CMD ["pnpm", "start"]
EXPOSE 3000
CMD ["npm", "run", "start"]
File renamed without changes.
Loading

0 comments on commit 1110284

Please sign in to comment.