docker-compose


two docker-compose .yml in the same network with COMPOSE_PROJECT_NAME


I am trying to have my own network name for my docker-compose files (server.yml and test.yml), as test.yml gets only started from time to time, but needs access to some services in the server.yml. I can make it work with docker-compose -p nameofproject up, but not with COMPOSE_PROJECT_NAME.
server.yml
version: '2'
networks:
mynetwork:
driver: bridge
services:
app1:
networks:
- mynetwork
environment:
POSTGRES_PASSWORD: somepassword
COMPOSE_PROJECT_NAME: serverstack
app2:
networks:
- mynetwork
environment:
COMPOSE_PROJECT_NAME: serverstack
depends_on:
- app1
My expectation is that when the container is starting I should see
Creating serverstackmynetwork_app_1
Creating serverstackmynetwork_app_2
the network should be named (docker network ls)
serverstack_mynetwork
just like when I do the following, which actually works
docker-compose -p serverstack up
And then I can connect just by using docker-compose up with the second file (which works just fine when using the -p option on the server.yml)
testing.yml
version: '2'
networks:
testapp_network:
external:
name: serverstack_mynetwork
services:
testapp:
networks:
- testapp_network
But using it without -p serverstack on the server.yml I see directories as names
Creating directoryofapp1_app1_1
Creating directoryofapp2_app2_1
so COMPOSE_PROJECT_NAME is being omitted and I also cannot connect to the server service though serverstack_mynetwork
I did add the COMPOSE_PROJECT_NAME: serverstack after building the image, but I would expect it should work anyhow. What am I missing?

Related Links

Defining project name inside docker-compose configuration
Docker-compose named mounted volume
cannot ping linked docker container service
How to do variable substitution in env_file?
How to create stack in tutum with docker-compose.yml file?
ecs-cli docker compose version
dynamic link update in docker-compose
How to start arbitrarily many identical containers with docker-compose?
How to stop docker-compose run command
Unable to run sensu check in a docker-compose context
Should I use docker-compose start or docker-compose up -d
Docker Compose automatically setting links
docker compose volumes not contains files
Inheritance or nesting with docker compose
Reading docker-compose environment variables in application code
Docker Compose wait for container X before starting Y

Categories

HOME
qlikview
actionscript-3
webvr
abc
data-modeling
squeak
coordinates
mingw
annyang
ionic-native
apache-httpclient-4.x
digital
aws-sdk-cpp
kairosdb
vichuploaderbundle
glibc
gomobile
cherrypy
dev-c++
connectiq
onclicklistener
advertising
windows-mobile
multiple-inheritance
proof-general
angular-schema-form
restangular
javapns
selenium3
arp
jmsserializerbundle
login-required
oracle-nosql
luhn
flickr
traitsui
powerbi-embedded
motherboard
mapquest
var
scalamock
mediastream
jvisualvm
qt-quick
f#-fake
gradlew
history
openidm
runtime-permissions
cancan
visio-2010
fckeditor
aot
opticalflow
multi-targeting
bipartite
wicketstuff
iban
toggleclass
settext
avaudiorecorder
music-player
skbio
hana-sql-script
jquery-draggable
google-app-engine-php
computability
gtkwave
tvp
biginsights
page-flipping
musicbrainz
jsoncpp
roslyn-code-analysis
borland-c++
fileinputstream
stderr
firebase-tools
sony-xperia
touch-typing
caption
xcode5
dojox.grid
oxygenxml
xts
amzi-prolog
cs193p
visual-studio-setup-proje
php-amqplib
maven-javadoc-plugin
friendly-url
gmail-imap
metapost
screensharing
report-viewer2010
advanceddatagrid
peoplepicker
cryptolicensing
rollover
mysql-logic
mysql-pconnect
tracd

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App