Deploying Server-Side Swift Apps With Docker on Heroku | Kodeco

In this tutorial, you’ll learn how to deploy server-side applications developed in Vapor as well as Docker images of your application into Heroku.


This is a companion discussion topic for the original entry at https://www.kodeco.com/33010416-deploying-server-side-swift-apps-with-docker-on-heroku

Helllo,

I’m building a Vapor server to be deployed to Heroku using Docker and when I run the following command from the Mac command line:
docker buildx build --tag publiccmsserver-app .

I get this error:
/build/.build/checkouts/gcsurlsigner/Sources/GCSURLSigner/GCSURLSigner.swift:2:8: error: no such module ‘Security’
#0 114.7 import Security

Any ideas how I can get the build to use the Apple’s Security framework. This code compiles fine inside Xcode.

Thanks.

Alfredo da Silva

When deploying in Heroku, there is no need to build the image locally. Actually, deployment can be done directly via Github or Heroku’s internal Git.

Thanks for your reply.

The plan is to deploy a Docker image to Heroku instead of deploying the code via Github or Heroku’s internal Git. as shown in this article:

The local image creation has a problem (as described in my previous message), I’m looking for a solution to provide access to Apple’s Security framework to the container during compilation.

Any idea on how to do that is very appreciated.

Thanks.

Alfredo da Silva

Please be aware that if you are using the Dockerfiles bundled with Vapor, they will build Linux based images, not macOS. If you are trying to use certain Frameworks that are Apple specific, then those libraries will not be available in the image.