diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..1c2ab8de0 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +FROM freqtradeorg/freqtrade:develop + +# Install dependencies +COPY requirements-dev.txt /freqtrade/ +RUN apt-get update \ + && apt-get -y install git sudo vim \ + && apt-get clean \ + && pip install numpy --no-cache-dir \ + # Install ALL dependencies + && pip install -r requirements-dev.txt --no-cache-dir \ + # Install documentation dependencies (to enable mkdocs) + && pip install -r docs/requirements-docs.txt --no-cache-dir \ + && useradd -m ftuser \ + && mkdir -p /home/ftuser/.vscode-server /home/ftuser/.vscode-server-insiders /home/ftuser/commandhistory \ + && echo "export PROMPT_COMMAND='history -a'" >> /home/ftuser/.bashrc \ + && echo "export HISTFILE=~/commandhistory/.bash_history" >> /home/ftuser/.bashrc \ + && chown ftuser: -R /home/ftuser/ + +USER ftuser + +# Empty the ENTRYPOINT to allow all commands +ENTRYPOINT [] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7a5e43cf1..1882e3bdf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,12 @@ { "name": "freqtrade Develop", - // Update the 'dockerComposeFile' list if you have more compose files or use different names. - // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ "docker-compose.yml" - // "docker-compose.vscode.yml" ], "service": "ft_vscode", - // The optional 'workspaceFolder' property is the path VS Code should open by default when - // connected. This is typically a file mount in .devcontainer/docker-compose.yml "workspaceFolder": "/freqtrade/", "settings": { diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 93ffee309..7cf3ba2f5 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -4,14 +4,17 @@ services: ft_vscode: build: context: .. - dockerfile: "Dockerfile.develop" + dockerfile: ".devcontainer/Dockerfile" volumes: - ..:/freqtrade:cached - freqtrade-vscode-server:/home/ftuser/.vscode-server - freqtrade-bashhistory:/home/ftuser/commandhistory - + # Expose API port + ports: + - "127.0.0.1:8080:8080" command: /bin/sh -c "while sleep 1000; do :; done" + volumes: freqtrade-vscode-server: freqtrade-bashhistory: diff --git a/docker-compose.develop.yml b/docker-compose.develop.yml deleted file mode 100644 index 562b5960a..000000000 --- a/docker-compose.develop.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -version: '3' -services: - freqtrade_develop: - build: - context: . - dockerfile: "./Dockerfile.develop" - volumes: - - ".:/freqtrade" - entrypoint: - - "freqtrade" - - freqtrade_bash: - build: - context: . - dockerfile: "./Dockerfile.develop" - volumes: - - ".:/freqtrade" - entrypoint: - - "/bin/bash"