wired up dockr compose and ttyd

This commit is contained in:
Aaron Job
2023-09-10 02:26:55 +00:00
parent d233db45d9
commit fc063fde06
3 changed files with 45 additions and 23 deletions

View File

@@ -1,15 +1,22 @@
FROM python:3
# Download precompiled ttyd binary from GitHub releases
RUN apt-get update && \
apt-get install -y wget && \
wget https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.x86_64 -O /usr/bin/ttyd && \
chmod +x /usr/bin/ttyd && \
apt-get remove -y wget && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
RUN python -m venv pilot-env
RUN source pilot-env/bin/activate
RUN pip install -r requirements.txt
RUN python ./pilot/db_init.py
RUN /bin/bash -c "source pilot-env/bin/activate"
CMD [ "python", "./pilot/main.py" ]
WORKDIR /usr/src/app/pilot
RUN pip install -r requirements.txt
EXPOSE 7681
CMD ["ttyd", "bash"]