The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi everyone,
I started some time ago defining some build steps into BB pipelines, I found many useful features, among them the definition of services.
I've tried a postgres and a rabbitmq image to test the application I'm working on and as far as I run the services with the default ports everything works smoothly.
Now I'm trying to define a service with a postgres container exposed on a port different from the default one.
definitions:
services:
postgres:
image: postgres:14
variables:
POSTGRES_PASSWORD: some_pass
POSTGRES_USER: some_user
ports:
"5433:5432"
This docker-like approach seems not to work, during the test steps the application is not able to reach the container.
Is there a way to achieve this without push/pull a custom image?
Thanks.
Best regards,
Federico
Hi Federico,
I'm afraid that we don't support port mapping.
However, it is possible to use the PGPORT environment variable here: https://www.postgresql.org/docs/14/libpq-envars.html
You can define the service in the bitbucket-pipelines.yml file as follows:
definitions:
services:
postgres:
image: postgres:14
environment:
POSTGRES_PASSWORD: 'test'
POSTGRES_DB: 'gstest'
PGPORT: '8432'
Is this something that works for you?
Kind regards,
Theodora
Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.