Comments (4)
Isn't it the same folder?
Yes, but the content of the tar file is a bit different. You want your captain definition to be at the root level of your tar file, not deep in a directory.
Final question though is, is this the best way to do this? I'm eventually going to have 3 captain definitions and docker files in my solution directory, which, for lack of a better phrase, is a bit ugly IMO. Is there a better way to set this up while still having all projects in the solution and repo?
If you want to share dockerfiles / captain-definition across multiple apps (API and Business), that's the best way to do it.
One more small question. After setting up both my API and STS projects, the only one I was able to hit both and not get a 502 was to set the container http port for both to be 8080. Is this correct? Why / how can both apps be on port 8080?
This is the container port, not the host port.
┌────────► App1:8080
│
│
User────► Port80───►CapRover(nginx)│
│
│
│
└────────► App2:8080
from caprover.
Try this one, does it work?
- uses: a7ul/[email protected]
with:
command: c
cwd: "./"
files: |
API/
outPath: deploy.tar
from caprover.
Hmmm, that seemd to solved it. Why does it matter if I use ../
and then reference the path vis VaulticServer/API
instead of ./
and just API
? Isn't it the same folder?
I'm also getting a second error, dockerfilePath should not refer to parent directory!
. This is in result of trying to include the Business project since the API project references it.
Following some stackoverflow threads, it seemed like the easiest solution was to have my dockerfile at the solution level. I moved it there so my file structure looks like:
-API/
----- captain-definition
-Business/
-APIDockerFile
I then just updated my captain definition to:
{
"schemaVersion": 2,
"dockerfilePath": "../APIDockerfile"
}
which causes the error.
new docker file just for reference:
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
# copy csprojs and restore as distinct layers
WORKDIR /src
COPY ["./API/API.csproj", "API/"]
COPY ["./Business/Business.csproj", "Business/"]
RUN dotnet restore "API/API.csproj"
# copy everything else and build
COPY . ./
WORKDIR "/src/API"
RUN dotnet build "API.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "API.csproj" -c Release -o /app/out
# build runtime image
FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /app
COPY --from=publish /app/out .
ENTRYPOINT ["dotnet", "API.dll"]
Is there anyway to have a docker file in the parent directory or do I instead need to change my docker file to work from within the API directory (hopefully possible)?
EDIT:
I am finding out docker does not allow copying files from outside where the docker file lies.
EDIT 2:
Ok I think I got it working. I had to move both the captain-definition and docker file to the solution level. Final structure:
- API/
- Business/
- api-captain-definition
- APIDockerFile
Include everything in github workflow:
command: c
cwd: "./"
files: |
./API
./Business
./api-captain-definition
./APIDockerFile
outPath: deploy.tar
I obviously also had to update my default captain-definition path for my caprover app.
Final question though is, is this the best way to do this? I'm eventually going to have 3 captain definitions and docker files in my solution directory, which, for lack of a better phrase, is a bit ugly IMO. Is there a better way to set this up while still having all projects in the solution and repo?
EDIT 3:
One more small question. After setting up both my API and STS projects, the only one I was able to hit both and not get a 502 was to set the container http port for both to be 8080. Is this correct? Why / how can both apps be on port 8080?
from caprover.
Ahh, that all makes sense. I appreciate you taking the time to explain it all!
from caprover.
Related Issues (20)
- [Deployment Issue] Deploy from github using image doesn't work. HOT 2
- How to update the certificate of my self hosted registry? HOT 1
- Net Core 8.0 github actions deploy HOT 1
- Deployment Issue: SourceGuardian PHP Extension on One-Click App HOT 7
- [Deployment Issue] persistent storage not available during deployment HOT 1
- Caprover does not clean up registry HOT 1
- [Deployment Issue] React App Refresh Results in 404 Error Despite Nginx Configuration Modifications HOT 4
- Problem renewing the ssl certificate from caprover HOT 2
- [Question] Set source directory HOT 3
- [Question] Access CapRover dashboard through a secure connection HOT 4
- Invalid credentials and Apps were incorrupted. HOT 1
- [Question] Can you use network_mode with CapRover HOT 1
- Recent Webhook malformed jet token HOT 4
- [Question] Is it possible to share captain overlay network between instances without joining swarm? HOT 1
- It is possible to config all in one nextcloud in caprover?
- HELP! CapRover (and all apps) send Error 521 after reboot HOT 1
- "caprover deploy -t ./deploy.tar" not working HOT 3
- Webhook Token too long for Github HOT 6
- Something bad happened while retrieving * app build logs. Too many wrong passwords... Wait for 30 seconds and retry. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caprover.