Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
docker file for frontend working now
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkamittal committed Oct 14, 2024
1 parent 253c1fb commit f68b092
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
frontend:
build:
context: ./frontend # Path to your front-end repository
dockerfile: Dockerfile
ports:
#- "8080:80" # Map host port to container port
- "5173:5173"
depends_on:
- backend # Ensure the backend service starts before frontend
environment:
- ASPNETCORE_ENVIRONMENT=Development
- API_URL=http://backend:80 # This points to the backend service within the Docker network


backend:
build:
context: . # Path to your back-end repository
dockerfile: Dockerfile
ports:
- "8080:80" # Map host port to container port
environment:
- ASPNETCORE_ENVIRONMENT=Development
18 changes: 18 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use the official Node.js image to build and run the back-end project
FROM node:18

# Set working directory
WORKDIR /app

# Copy package.json and install dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of the code
COPY . .

# Expose the API port (e.g., 5000)
EXPOSE 5000

# Start the Node.js server
CMD ["npm", "run", "preview"]

0 comments on commit f68b092

Please sign in to comment.