Before performing a Deployment, it's assumed that the following have been set up:
- OS X 10.13.6+
- Swift 4.2.1 (Perfect framework supports this version)
- Docker
server
- the directory with sample server written in Swift (with Perfect framework)mysql
- the directory with Dockerfile used to create MySQL imagedocs
- this directory contains the documentation, including this deployment guide
- Perfect and its subframeworks
- SwiftyJSON
The server can be configured using environment variables or right in server/SampleServer/Sources/SampleServer/Configuration.swift
:
The environment variables should be provided in docker-comppose.yml
:
DATABASE_NAME
- the database name. Check that content ofmysql/Docker
and make sure the database name is the same;DATABASE_HOST
- the host where MySQL is installed. It should be the name of the corresponding container if launched in a "docker network";DATABASE_USERNAME
- database username used to connect;DATABASE_PASSWORD
- database password used to connect.
docker-compose up --build
Follow README.md files in server/
and mysql/
directories for more information.
- Launch the containers using
docker-compose up --build
command as mentioned above - Use Postman sample requests provided in
docs/postman
to verify the server.