Skip to content

Commit

Permalink
Basic docker vscode dev container with python base image.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnzagustin committed Apr 20, 2021
1 parent cb31627 commit cb60c80
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.122.1/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "Python(Extend)",

// 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.dev.yml"
],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "python",

// 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": "/usr/src/app",

// Add the IDs of extensions you want installed when the container is created.
"extensions": [],

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "bash"
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gitignore
/docker/
13 changes: 13 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.7"

services:
python:
build:
context: ./
dockerfile: ./docker/Dockerfile
volumes:
- .:/usr/src/app
env_file:
- docker.environment
networks:
- default
Empty file added docker.environment
Empty file.
7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.9

COPY [".", "/usr/src/app"]

WORKDIR /usr/src/app

CMD tail -f /dev/null

0 comments on commit cb60c80

Please sign in to comment.