Dockerfiles that ships with dependencies for running Vapor projects (including CStack) on Linux. These images are used in our Circle CI scripts.
Currently we have the following images:
Dockerfile-Swift3which is using Swift 3 and is supposed to be used for Vapor 1 projects. The image is pushed to here.Dockerfile-Swift4which is using Swift 4 and is supposed to be used for Vapor 2 projects. The image is pushed to hereDockerfile-Swift4.1which is using Swift 4.1 and is supposed to be used for Vapor 2 or 3 projects. The image is pushed to here with tag "swift-4.1".Dockerfile-Swift4.2which is using Swift 4.2 (release) and is supposed to be used for Vapor 2 or 3 projects. The image is pushed to here with tag "swift-4.2".Dockerfile-Swift5which is using Swift 5.0 and is supposed to be used for Vapor 3 or 4 projects. The image is pushed to here with tag "swift-5.0".
A guide for building new images based on Dockerfiles can be found here.
To make it easier to run a Vapor app through a Docker container, we have the following Dockerfiles for guidance:
Hosting/Dockerfile-Swift4.1which is using Swift 4.1 and is supposed to be used for Vapor 2 or Vapor 3 projects.Hosting/Dockerfile-Swift4.2which is using Swift 4.2 and is supposed to be used for Vapor 2 or Vapor 3 projects.Hosting/Dockerfile-Swift5.0which is using Swift 5.0 and is supposed to be used for Vapor 3 or Vapor 4 projects.
Further, we have the following Docker Compose files for spinning up full environments including database and Redis:
Hosting/docker-compose-mysql.ymlwhich is using MySQL 5.7 and the latest version of Redis.
To make it easier to test Vapor apps locally on Linux using Docker, we have made the following Dockerfiles:
Testing/Dockerfile-Swift4.1which is using Swift 4.1 and is supposed to be used for Vapor 2 or Vapor 3 projects.Testing/Dockerfile-Swift4.2which is using Swift 4.1 and is supposed to be used for Vapor 2 or Vapor 3 projects.
Environment variables are supported in Docker. Please read the docs regarding environment variables for info regarding how to configure them.
In short composer prioritizes environment variables in the following order:
- Compose file
- Shell environment variables
- Environment file
- Dockerfile
- Variable is not defined
If you want to use a .env-file, make sure to remove the environment section in your docker-compose file as described in the docs, referenced above.
This package is developed and maintained by the Vapor team at Nodes. The package owner for this project is Steffen.
This package is open-sourced software licensed under the MIT license