I'm using this tutorial as a basis:
https://confluence.atlassian.com/bitbucket/deploy-to-amazon-ecs-892623902.html
but I can't get my head around the step that moves the built app into the docker images (which we then push to docker hub)
Is it in the docker file,
# Bundle app source
COPY . /usr/src/app
or in the bitbucket-pipelines.yml?
# build and test the Node app
- npm install
- npm test
My guess is in the docker file.... in which case, does the 'dot' signify the root directory of the repository that the pipeline is acting upon and the /usr/src/app relate to the filesystem of the target docker image?
Many thanks
Matt
Hello Matt,
The step that moves the built app into the Docker image is the one in the Dockerfile.
# Bundle app source
COPY . /usr/src/app
The NPM install and NPM test steps are used if you're building are Javascript or NodeJS application. If you're building a .war, I assume you're using Java (or another JVM language)?
In that case, instead of using NPM commands, you would use whatever commands you use locally to build you .war (such as Maven or Gradle).
Likewise, your Dockerfile would have to be modified to handle Java instead of NPM:
FROM openjdk:8
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Add the .war
COPY . /usr/src/app
EXPOSE 8080
CMD [ "java", "/usr/src/app/.war" ] # replace this with whatever command you use to start your application.
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.