Last active
February 9, 2019 17:24
-
-
Save angeloreale/6bcbb932a88662cae7cb87eae14144f7 to your computer and use it in GitHub Desktop.
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/yournodeservice.service | |
[Unit] | |
Description=Docker Compose Application Service | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Type=simple | |
RemainAfterExit=yes | |
WorkingDirectory=/path/to/prod/ #path to your dev/prod node service | |
ExecStart=/usr/local/bin/docker-compose up --no-deps --force-recreate -d dev/prod #starts your dev/prod node service | |
ExecStop=/usr/local/bin/docker-compose stop dev/prod #stops your dev/prod node service | |
TimeoutStartSec=0 | |
Restart=always | |
StartLimitIntervalSec=60 | |
StartLimitBurst=3 | |
Requires=mongo.service #your mongo service | |
After=mongo.service #your mongo service | |
[Install] | |
WantedBy=multi-user.target | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment