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)
- How to access an app from behind firewall only? HOT 1
- Bumping the version of a One Click deployment? HOT 4
- Is it possible to specify run arguments without a custom dockerfile? HOT 3
- caprover/deploy-from-github can I just tag latest? HOT 1
- caprover container not starting after updating to v1.12.0 HOT 2
- Missing timezone setting and change apps date format HOT 7
- App logs textarea can't be manually resized. HOT 2
- Why does CapRover push my image to GHCR? HOT 1
- [Deployment Issue] All Caprover 1-click Apps display: nothing here yet - Latest version, clean install, multiple VPS Providers HOT 1
- [Deployment Issue] I can't access the caprover domain HOT 12
- Cannot enable HTTPS on connected domains (oneclick wordpress, new app, old server) HOT 1
- Cannot creat one-click app - Error: Push failed HOT 1
- [Deployment Issue] what is appending captain to my webseite when deployed using github workflow HOT 4
- Stripe Environment Variables HOT 6
- Log Search filter crash on invalid Regex HOT 1
- Colored Logs
- Allow numbers in subdomains
- Allow installation without relying on local node HOT 8
- 502 Bad Gateway nginx on fresh install (ssh port not 22) HOT 4
- [Question] how to change domain? HOT 2
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.