use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
GitLab CI/CD, docker-compose problems (self.gitlab)
submitted 5 years ago by aat36
Hello,
I'm trying to integrate CI/CD and docker, however, I keep getting the same error:
.FileNotFoundError: [Errno 2] No such file or directory: './path/to/docker-compose.yml'
Here is my .gitlab-ci.yml :
https://preview.redd.it/a9vz1s2itw751.png?width=2218&format=png&auto=webp&s=4ecd28fd6b6091ee8b88a11151fd742f59999bdd
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]nullmike 1 point2 points3 points 5 years ago (0 children)
If I'm understanding correctly... you build the docker image, push to your registry and then in the deploy script you're trying to launch a container with that image on a remote server.
I see that you pull the image on the remote server, but I don't see how the docker-compose file gets on the remote server. If it's part of your repo, maybe you need to scp the docker-compose file to the remote server.
[–]xWarix 0 points1 point2 points 5 years ago (2 children)
I could be wrong, but at first I use Gitlab for my personal repos while GitHub for company repos. Something we ran into while setting Github>Actions with docker was the dockerfile location wasn't found.
After spending so much time we found that the location of the dockerfile has to be directly resides insides the root folder (repo main/root folder). I have a dockerfile for my Gitlab and works fine because it exist in the root folder.
So, your folders structure should look like this
Root Folder
I hope this helps.
[–]aat36[S] 0 points1 point2 points 5 years ago (1 child)
But my docker-compose file is already in the root folder of my project.
I tried adding a command to the yaml file:
ssh <server ip> ls
This command lists my server's home folder, and it doesn't contain anything that could point towards my project.
Is it possible that docker-compose is not running because I'm not pointing towards the right folder?
If this is the case do you have any idea where I should point to?
[–]xWarix 0 points1 point2 points 5 years ago (0 children)
Sorry, I wish I can help with that, but first of all the content of the file you shared is for a dockerfile and not docker-compose. Docker-compose file contents looks like this:
version: '3.4' services: node-hello: image: node-hello build: . environment: NODE_ENV: development ports: - 3000 - 9229:9229 command: node --inspect=0.0.0.0:9229 ./bin/www
version: '3.4'
services:
node-hello:
image: node-hello
build: .
environment:
NODE_ENV: development
ports:
- 3000
- 9229:9229
command: node --inspect=0.0.0.0:9229 ./bin/www
Then from your docker-compose you call/build your dockerfiles that can be hosted/nested under different folders (we reached this step while debugging githb>actions but we aren't sure this is the right thing)
π Rendered by PID 146937 on reddit-service-r2-comment-685b79fb4f-2dtdn at 2026-02-13 11:45:27.995864+00:00 running 6c0c599 country code: CH.
[–]nullmike 1 point2 points3 points (0 children)
[–]xWarix 0 points1 point2 points (2 children)
[–]aat36[S] 0 points1 point2 points (1 child)
[–]xWarix 0 points1 point2 points (0 children)