4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker-compose で簡単! 最小お手軽構成のPythonテスト環境

Last updated at Posted at 2018-02-27

お手軽Python環境を構築しました。

手順

  • docker-compose.yml ファイルを作る
  • test.pyみたいな適当なPythonファイルを作成する
  • docker-compose up -d
  • docker exec -it python /bin/bash
  • Pythonのコードを書いて色々テストや検証をする

サンプルコード

書いたコードはこちら

docker-compose.yml

docker-compose.yml
version: '3'
services:
  app:
    image: python:3.6
    volumes:
      - './:/var/www/html'
    container_name: python
    tty: true
    working_dir: '/var/www/html'

test.py

test.py
print('Hello world')

Githubに置きました。

ここにアクセス! tyamahori

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?