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

Yesod and docker-compose logs in development mode
Docker compose to always deploy using latest image
JHipster - Doubts in the development using Microservices Architecture
Gogs + Drone getsockopt: connection refused
Concourse result keeps loading
Docker-compose: AttributeError: 'module' object has no attribute 'ssl'
scaling a service with docker compose
Docker Compose apparently ignores COMPOSE_FILE
Where does Docker install gems on a mac
What is the difference between docker-machine and docker-compose?
Docker Compose port issue. Cannot launch docker project on localhost
Name an image built from running a docker-compose file
Race conditions after changing names in docker-compose.yml
Docker compose - image not found
How to work out the hostname that compose gives containers?
docker-compose restart container if service is dead

Categories

HOME
ssms
teradata
locale
grpc
intellisense
skypedeveloper
ebay-api
grid
docker-compose
token
apache-httpclient-4.x
kairosdb
oxid
infopath
nsoperation
wallet
novacode-docx
printf
angular2-pipe
fastboot
connection-pooling
handle
functional-dependencies
symlink
launchd
ocl
ios9
selenium3
multilanguage
urhosharp
epub
ilog
incapsula
dom4j
cocoa-scripting
flex3
console.readline
queryover
area
office-interop
colorbox
superclass
libzip
intervention
grails-2.0
ocpjp
weld
spring-ide
opos
evaluation
serialversionuid
ear
xamarin-test-cloud
huawei
spring-social-twitter
addressbook
blackberry-webworks
zsh-completion
racket-student-languages
deck.js
vga
cherry-pick
kik
avaudiorecorder
innertext
music-player
nslocalizedstring
videoview
magnet-uri
event-tracking
webservices-client
azure-mobile-app
android-networking
chrome-mobile
data-quality-services
jad
touch-typing
api-eveonline
gnip
fscanf
pidgin
starling-framework
jfilechooser
asp.net-4.0
ncml
gssapi
netzke
hypertable
sup
animationdrawable
motorola-droid
umfpack
discussion-board
lwp
response-time
rollover
for-xml
glassfish-embedded
retrospectiva
atmega16

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