-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.windows
More file actions
34 lines (25 loc) · 1.16 KB
/
Dockerfile.windows
File metadata and controls
34 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use a Windows-compatible Python image as the base
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Install Python 3.10
RUN Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe" -OutFile "python-3.10.11-amd64.exe" ; \
Start-Process python-3.10.11-amd64.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait ; \
Remove-Item -Force python-3.10.11-amd64.exe
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set work directory
WORKDIR /app
# Install Poetry
RUN pip install --no-cache-dir poetry
# Copy project files
COPY . /app
# Install project dependencies
RUN poetry config virtualenvs.create false ; \
poetry install --no-interaction --no-ansi --no-root
# Create entrypoint script
RUN echo '$ErrorActionPreference = ''Stop''; $ProgressPreference = ''SilentlyContinue''; jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root' > C:\entrypoint.ps1
# Expose port for Jupyter
EXPOSE 8888
# Set entrypoint
ENTRYPOINT ["powershell", "-File", "C:\\entrypoint.ps1"]