I have a meteor app in a docker which starts a test server and my pr-test script should start the acceptance tests with puppeteer.
When I run my docker file locally, I can access it from outside with my tests on http://localhost:3100 but on Bitbucket the tests fail because the URL is not accessible.
Would be very happy for any help on this.
If there are open questions just ask.
My pipeline looks like this and recording to the validator it is ok.
image: node:8.15.1
pipelines:
default:
- step:
services:
- docker
caches:
- node
script:
- if [ "${BITBUCKET_PR_DESTINATION_BRANCH}" != "develop" ]; then printf 'not a target branch we want to check'; exit; fi
- echo "A pull-request has been made."
- apt update && apt install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
- cd ./code
- docker build -t tc .
- docker run -id -p 3100:3100 tc
- npm install
- npm run pr-test
definitions:
services:
docker: memory: 3072
I have following Dockerfile:
FROM node:8.15.1-slim
ENV METEOR_VERSION 1.8.1
RUN apt-get update -q -q && \ apt-get --yes --force-yes install procps curl net-tools python build-essential git
ENV METEOR_ALLOW_SUPERUSER true
RUN curl https://install.meteor.com/release=${METEOR_VERSION} | sh
RUN PATH="/usr/local/bin/meteor:${PATH}"
ENV PATH="/usr/local/bin/meteor:${PATH}"
COPY . /trusted-care
WORKDIR /trusted-care
RUN meteor --version
RUN npm install --production
RUN npm link .local_modules/jest-cucumber/
WORKDIR /trusted-care/.local_modules/jest-cucumber
RUN npm install
WORKDIR /trusted-care
RUN npm install --save-dev lolex
USER root
EXPOSE 3100
CMD meteor npm test