Skip to content

Instantly share code, notes, and snippets.

@kwbr
Forked from aprxi/docker-compose.yml
Created March 25, 2021 06:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
docker-compose.yml_20190214
version: '3.4'
services:
main:
# Makefile fills PROJECT_NAME to current directory name.
# add UID to allow multiple users run this in parallel
container_name: ${PROJECT_NAME}_${HOST_UID:-4000}
hostname: ${PROJECT_NAME}
# These variables are passed into the container.
environment:
- UID=${HOST_UID:-4000}
# Run with user priviliges by default.
user: ${HOST_USER:-nodummy}
image: ${PROJECT_NAME}:${HOST_USER:-nodummy}
build:
context: .
# Build for current user.
target: user
dockerfile: Dockerfile
# These variables are passed to Dockerfile.
args:
- HOST_UID=${HOST_UID:-4000}
- HOST_USER=${HOST_USER:-nodummy}
# Run container as a service. Replace with something useful.
command: ["tail", "-f", "/dev/null"]
# Copy current (git-) project into container.
volumes:
- ${PWD:-.}:/home/${HOST_USER}/${PROJECT_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment