forked from ossamamehmood/Hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[MathewJack]
committed
Oct 11, 2023
1 parent
2ac9002
commit e32f974
Showing
1 changed file
with
24 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,24 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.9-slim | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Install required Python packages without cache | ||
RUN pip install --no-cache-dir ipykernel && \ | ||
python -m ipykernel install --sys-prefix && \ | ||
pip install --no-cache-dir SQLite4 pandas numpy jupyter | ||
|
||
# Install SQLite3 and create a sample database | ||
RUN apt-get update && apt-get install -y sqlite3 && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
RUN sqlite3 /app/sample.db "CREATE TABLE random_data (id INTEGER PRIMARY KEY, data TEXT); INSERT INTO random_data (data) VALUES ('Hello, world');" | ||
|
||
# Create a Jupyter config file with no token for security (You can change this for production use) | ||
RUN jupyter notebook --generate-config && \ | ||
echo "c.NotebookApp.token = ''" >> ~/.jupyter/jupyter_notebook_config.py | ||
|
||
# Expose Jupyter Notebook port | ||
EXPOSE 8888 | ||
|
||
# Start Jupyter Notebook | ||
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] |