Skip to content

Added Dockerfiles for api and Frontend #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official Python image from the Docker Hub
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container
COPY api/requirements.txt .

# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the container

COPY api/ .

# Command to run the FastAPI server

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

32 changes: 32 additions & 0 deletions front-end-nextjs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Use the official Node.js image from the Docker Hub

FROM node:16-alpine

# Set the working directory in the container

WORKDIR /app

# Copy the package.json and package-lock.json files

COPY frontend/package*.json ./

# Install the dependencies

RUN npm install

# Copy the rest of the application code into the container

COPY frontend/ .

# Build the Next.js application

RUN npm run build

# Expose port 3000 to the outside world

EXPOSE 3000

# Command to run the Next.js server

CMD ["npm", "start"]