-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85dd658
commit d09ec62
Showing
8 changed files
with
155 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,28 @@ | ||
# Use the official Python image as a parent image | ||
FROM python:3.9-slim | ||
|
||
# Set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
libpq-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python dependencies | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the project files | ||
COPY . . | ||
|
||
# Expose the port | ||
EXPOSE 8000 | ||
|
||
# Run the Django development server | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
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,28 @@ | ||
FROM node:18.19 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json from the Angular app directory | ||
COPY ./app/package*.json ./ | ||
|
||
# Install Angular CLI globally | ||
RUN npm install -g @angular/cli | ||
|
||
# Install frontend dependencies | ||
RUN npm install | ||
|
||
# Copy the entire Angular app to the working directory | ||
COPY ./app . | ||
|
||
# Build the Angular application for production | ||
RUN ng build --configuration production | ||
|
||
# Install a lightweight HTTP server to serve the application | ||
RUN npm install -g http-server | ||
|
||
# Expose the port the application will run on | ||
EXPOSE 8080 | ||
|
||
# Serve the Angular application | ||
CMD ["http-server", "dist/your-angular-app-name", "-p", "8080"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,46 @@ | ||
services: | ||
backend: | ||
build: | ||
context: ./LMS-Backend | ||
dockerfile: Dockerfile | ||
command: python manage.py runserver 0.0.0.0:8000 | ||
volumes: | ||
- ./LMS-Backend:/app | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- mongodb | ||
- redis | ||
environment: | ||
- MONGO_HOST=mongodb | ||
- MONGO_PORT=27017 | ||
- REDIS_HOST=redis | ||
- REDIS_PORT=6379 | ||
|
||
frontend: | ||
build: | ||
context: ./LMS-Frontend | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./LMS-Frontend:/app | ||
stdin_open: true | ||
tty: true | ||
|
||
mongodb: | ||
image: mongo:5.0 | ||
container_name: mongo | ||
ports: | ||
- "27017:27017" | ||
volumes: | ||
- mongodb_data:/data/db | ||
|
||
redis: | ||
image: redis:6 | ||
container_name: redis | ||
ports: | ||
- "6379:6379" | ||
|
||
volumes: | ||
mongodb_data: |