Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto dev
  • Loading branch information
faisalEsMagico committed Dec 14, 2023
2 parents f9ed320 + e452478 commit 146b53a
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
# DEVELOPMENT TOOLS
# Ideally, don't add them to production deployment envs
# !STARTERCONF Change to true if you want to log data
NEXT_PUBLIC_SHOW_LOGGER="false"
NEXT_PUBLIC_SHOW_LOGGER="false"
PORT=3400
NEXT_PUBLIC_MARKETPLACE_BACKEND_URL='http://localhost:4020'
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Stage 1: Build Stage
FROM node:18-alpine AS build

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code to the container
COPY . .
COPY .env.example ./env.local

# Build the Next.js app
RUN npm run build

# Stage 2: Runtime Stage
FROM node:18-alpine

# Set the working directory inside the container
WORKDIR /app

# Copy only necessary files from the build stage
ENV NODE_ENV production

COPY --from=build /app/next.config.js ./next.config.js
COPY --from=build /app/public ./public
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY .env.example ./env.local

# Expose the desired port
EXPOSE 3400

# Start the Next.js app
CMD ["node", "server.js"]
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const marketBackendUrl =
process.env.NEXT_PUBLIC_MARKETPLACE_BACKEND_URL || 'http://localhost:3000';
process.env.NEXT_PUBLIC_MARKETPLACE_BACKEND_URL || 'http://localhost:4020';

module.exports = {
marketBackendUrl,
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
marketplace-ui:
build:
context: .
dockerfile: Dockerfile
ports:
- "3400:3000"
networks:
- samagra_compass

networks:
samagra_compass:
external: true
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const nextConfig = {

reactStrictMode: true,
swcMinify: true,

output: 'standalone',
// Uncoment to add domain whitelist
images: {
remotePatterns: [
Expand Down

0 comments on commit 146b53a

Please sign in to comment.