Skip to content
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
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Base image with g++ and build tools
FROM ubuntu:22.04

# Prevent prompts from tzdata
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && apt-get install -y \
g++ \
make \
build-essential \
nano \
cmake \
git \
&& rm -rf /var/lib/apt/lists/*

# Create app directory
WORKDIR /app

# Copy all project files to /app in container
COPY . .

# Compile the code
RUN make

# Set the default command to run the compiled app
CMD ["./Netflix"]

# Build Docker Image
docker build -t netflix-app .

# Run Docker Image
docker run -it netflix-app
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CXX = g++
CXXFLAGS = -std=c++17 -Wall
SOURCES = main.cpp user.cpp admin.cpp content.cpp persistence.cpp init_content.cpp
OBJECTS = $(SOURCES:.cpp=.o)
TARGET = Netflix

all: $(TARGET)

$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJECTS)

%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
rm -f *.o $(TARGET)
Loading