mtle_hw2 / Dockerfile
zyliu's picture
Update Dockerfile
e5f1a98
raw
history blame
804 Bytes
# Use the official Python image as a base image
# FROM python:3.8-slim-buster
FROM mongo:latest
# RUN apt-get update
# RUN apt-get install -y gnupg curl
# RUN curl -fsSL https://pgp.mongodb.com/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
# RUN echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list
# # Install MongoDB
# RUN apt-get update && apt-get install -y mongodb-org
RUN mkdir -p /data/db
RUN chown -R mongodb:mongodb /data/db
RUN service mongodb start
# Copy the app code to the image
COPY . /app
WORKDIR /app
# Install the app dependencies
RUN pip install -r requirements.txt
# Run the app
CMD ["streamlit", "run", "app.py"]