Skip to content

Commit

Permalink
added myself-sql
Browse files Browse the repository at this point in the history
  • Loading branch information
[MathewJack] committed Oct 11, 2023
1 parent 2ac9002 commit e32f974
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Add Code Here/Docker/Docker-juypter-sql/Dockerfile-SQL
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"]

0 comments on commit e32f974

Please sign in to comment.