Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Update docker-compose.yml files to mount .gitconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 26, 2019
1 parent 63cc884 commit 1641597
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@
version: '3'
services:
your-service-name-here:
# Using a Dockerfile is optional, but included for completeness.
build:
context: .
dockerfile: .devcontainer/Dockerfile # Using a Dockerfile is optional, but included for completeness.
dockerfile: .devcontainer/Dockerfile

# Application port(s) to expose
ports:
- "3000:3000" # Application port to forward
- "3000:3000"

volumes:
- ..:/workspace # This is where VS Code should expect to find your project's source code, value of "volume" in .vscode/devContainer.json
# This is where VS Code should expect to find your project's source code
# and the value of "workspaceFolder" in .devcontainer/devcontainer.json
- ..:/workspace

command: sleep infinity # This prevents the container from shutting down if you stop your application
# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity

Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ services:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspace

# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# Forwarding the socket is optional, but lets docker work inside the container if you install the Docker CLI.
# See the docker-in-docker-compose definition for details on how to install it.
- /var/run/docker.sock:/var/run/docker.sock

# Overrides default command so things don't shut down after the process ends. Optional, but useful for debugging.
# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ services:
context: .
dockerfile: Dockerfile
volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspace

# Forwarding the socket is the key to getting this to work
# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# Forwarding the socket is optional, but lets docker work inside the container if you install the Docker CLI.
# See the docker-in-docker-compose definition for details on how to install it.
- /var/run/docker.sock:/var/run/docker.sock

# Overrides default command so things don't shut down after the process ends - useful for debugging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ services:
build:
context: .
dockerfile: Dockerfile

volumes:
- ..:/workspace
# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity

links:
- mongo

mongo:
image: mongo
volumes:
Expand Down
6 changes: 6 additions & 0 deletions containers/python-3-postgres/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ services:
build:
context: ..
dockerfile: .devcontainer/Dockerfile

volumes:
- ..:/workspace
# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity

db:
image: postgres
restart: always
Expand Down

0 comments on commit 1641597

Please sign in to comment.