Using docker-compose.yml and Dockerfile with devcontainer.json and vscode dev containers ๐Ÿณ๐Ÿ’ป

This took me a little bit of fiddling around, and I wanted to share it with you ๐Ÿ˜Ž

{
    "name": "Python Project",
    "build": {
        "dockerfile": "Dockerfile",
        "context": "..",
        "args": {
            "VARIANT": "3.9"
        }
    },
    "runArgs": [
        "--init"
    ],

    "forwardPorts": []
}

version: '3'
services:
  app:
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    volumes:
      - ..:/workspace:cached
    command: /bin/sh -c "while sleep 1000; do :; done"

FROM mcr.microsoft.com/devcontainers/python:3.7

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends \
       build-essential \
       libpq-dev

ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1


COPY requirements.txt .
RUN pip install -r requirements.txt

WORKDIR /workspace
# To ensure app dependencies are ported from your virtual environment/host machine into your container, run 'pip freeze > requirements.txt' in the terminal to overwrite this file
tensorflow
stable-baselines3 
gym-anytrading
gym
python-binance
ccxt

Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *