This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker file for frontend working now
- Loading branch information
1 parent
253c1fb
commit f68b092
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |