-
Notifications
You must be signed in to change notification settings - Fork 23
/
docker-compose.yml
31 lines (31 loc) · 1.11 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# THIS SPECIFIC FILE IS DISTRIBUTED UNDER THE UNLICENSE: http://unlicense.org.
#
# YOU CAN FREELY USE THIS CODE EXAMPLE TO KICKSTART A PROJECT OF YOUR OWN.
# FEEL FREE TO REPLACE OR REMOVE THIS HEADER.
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}