-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
34 lines (34 loc) · 1.17 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
32
33
34
# 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.7'
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}
- PORT=${PORT:-9000}
# 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}
- PROJECT_NAME=${PROJECT_NAME}
- PORT=${PORT:-9000}
# Run container as a service. Replace with something useful.
command: ["node", "server.js"]
# Espose ports to the HOST:OTHER_CONTAINERS
ports:
- ${PORT:-9000}:${PORT:-9000}