Skip to content

Commit

Permalink
master > master: ignore - data should NOT be copied in Dockerfile, on…
Browse files Browse the repository at this point in the history
…ly dynamically mounted via docker-compose
  • Loading branch information
RLogik committed Jul 26, 2021
1 parent 7d78068 commit 4cbd73e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 44 deletions.
19 changes: 13 additions & 6 deletions templates/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,29 @@
# PROJECT FILES
################################################################

# !/src
# !/test
# !/dist
# !/dist/VERSION
!/src
!/src/**

!/test
!/test/**

################################################################
# AUXLIARY
# EXCLUDED FOLDERS (e.g. for mount-only volumes)
################################################################

/dist
/data
/build
/logs

################################################################
# ARTEFACTS
################################################################

#
## e.g.
# /**/__pycache__
# /**/.DS_Store
# /**/__archive__*

################################################################
# Git Keep
Expand Down
17 changes: 13 additions & 4 deletions templates/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@
# PROJECT FILES
################################################################

# !/src
# !/test
# !/dist
# !/dist/VERSION
!/src
# !/src/**

!/test
# !/test/**

!/data
/data/**
!/data/*-example.*

!/dist
!/dist/VERSION
# !/dist/*.zip

################################################################
# AUXLIARY
Expand Down
78 changes: 44 additions & 34 deletions templates/.whales.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,47 @@ networks:
default:
driver: bridge
services:
# !!! Your services here !!! #
### EXAMPLES:
# #---------------------------------------------------------#
# # SERVICE: Production
# #---------------------------------------------------------#
# prod-service:
# image: prod:build
# build:
# context: .
# dockerfile: .whales.Dockerfile
# args: &ref_build_args
# WD: "$WD"
# volumes: &ref_volume_args
# - ./logs:$WD/logs:rw ## <- (r/)w for logging between all docker levels.
# - ./src:$WD/src:rw ## <- r/w allows for live developing
# - ./test:$WD/test:rw ## ""
# - ./data:$WD/data:rw ## <- r/w data folder, images will be stored here.
# - ./dist:$WD/dist:rw ## <- r/w distribution folder, VERSION + Programme artefacts.
# - ./build:$WD/build:rw ## <- (r/)w build folder -> artefacts
# command:
# [ "/bin/bash", "-c", "echo -e \"Service built.\"" ]
# #---------------------------------------------------------#
# # SERVICE: Test
# #---------------------------------------------------------#
# test-service:
# image: test:build
# build:
# context: .
# dockerfile: .whales.Dockerfile
# args:
# <<: *ref_build_args
# volumes: *ref_volume_args
# command:
# [ "/bin/bash", "-c", "echo -e \"Service built.\"" ]
## !!! Your services here !!!
## EXAMPLES:
#---------------------------------------------------------#
# SERVICE: Production
#---------------------------------------------------------#
prod-service:
image: prod:build
build:
context: .
dockerfile: .whales.Dockerfile
args: &ref_build_args
WD: "$WD"
volumes:
- ./data:$WD/data:rw
- ./dist:$WD/dist:rw
- ./src:$WD/src:ro
# ## for debugging purposes only:
# - ./scripts:$WD/scripts:ro
# - ./logs:$WD/logs:rw
# - ./build:$WD/build:rw
command:
[ "/bin/bash", "-c", "echo -e \"Service built.\"" ]
#---------------------------------------------------------#
# SERVICE: Test
#---------------------------------------------------------#
test-service:
image: test:build
build:
context: .
dockerfile: .whales.Dockerfile
args:
<<: *ref_build_args
- ./test:$WD/test:ro
volumes:
- ./data:$WD/data:rw
- ./dist:$WD/dist:rw
- ./src:$WD/src:ro
- ./test:$WD/test:ro
# ## for debugging purposes only:
# - ./scripts:$WD/scripts:ro
# - ./logs:$WD/logs:rw
# - ./build:$WD/build:rw
command:
[ "/bin/bash", "-c", "echo -e \"Service built.\"" ]

0 comments on commit 4cbd73e

Please sign in to comment.