Lurker News
I am still frustrated with the amount of incidental complexity required whenever I want to do this. My latest attempt was to use a Digital Ocean droplet with Django pre-installed. I guess the biggest issue there was setting up something so that I could easily deploy my local version to the droplet (ended up using git/Github), and ensuring those two environments were in sync. I looked into Docker in some detail about a year ago, and I think it's the only pretty good solution for this I've come across—but there's a steep up front cost in learning/setup etc. (or so it seems).

What services and technologies do you use when you'd like to quickly build a web app which may never be more than a prototype, but may also turn into something real? A big aspect of what I'm wondering is about automatically setting something up for keeping local/production environments in sync, quickly deploying to production, and not having to mess with a bunch of server configuration things, user accounts, security, etc.

Comments (558) 189 threads

Earlier comments
DanHulton1 reply#
If you have the luxury of picking your stack, and don't mind using modern, clean PHP, try Laravel and Forge.

Laravel is a solid framework, and Forge handles the deploys, even going so far as to be able to deploy automatically when you push to master. Plus, you can use Laravel Spark to build an application framework base, with user login, teams, payment, all that written for you.
If you're not able to pick your stack, well, Ansible is pretty easy to learn. You can use Vagrant for the local dev, and ansible-vault for production secrets management. Deploys become a single command line, and that includes when you want to push an environment update.

Implicated#
I'll second this.

Laravel + Laravel Homestead (Pre-configured Vagrant VM) + Laravel Forge [2] (Server config + deployment processes) makes my life too easy.
It doesn't even have to be a PHP/Laravel project for this process to really make your life easy.
The Homestead VM has the same services installed and configured the same was as the forge server. Nginx (or Apache), mysql/mariadb, postgres, sqlite, node/bower/grunt/gulp, redis, memcached, beanstalkd, elasticsearch, go, etc
Homestead has pre-built commands to make it very easy to add new sites/projects, does the port forwarding for you, handles the shared folders easily. Forge's UI allows you to not have to ssh into the server for things like restarting nginx/mysql/postgres, 2 click let's encrypt SSL certs, configure/restart queue workers (via supervisord), configure cron scripts and schedules, deploy via git with custom deploy scripts. You can create databases, create database users and manager their permissions. Create firewall rules and manage daemons.
I spend all day in the PHP/Laravel ecosystem so it works for me - but I find myself pushing non-PHP products through the same pipeline most of the time because it's so easy and just works.
1. https://laravel.com/docs/5.6/homestead 2. https://forge.laravel.com/features

innomatics2 replies#
Django, Docker and AWS ECS and ELB.

Absolutely worth the effort to learn how to build a Docker image and put together bash scripts to push the image and update an ECS service. We have a base project which includes nginx and uwsgi set up to simply serve the Django app and static files on port 80.
Having an ECS Docker cluster with spare capacity greatly assists getting new projects up and running quickly, especially if we can run the test site under an existing domain managed in AWS. Then we can just add new rules on an existing ELB and piggy back on the SSL certificate.
With this workflow we spend the time getting a good image running locally (with local environments vars/secrets) and we know the deployment side is taken care of, and can be scaled if and when is needed. This also has the benefit of forcing dependencies and environments to be fully documented from the start (in the Dockerfile).
The next step, if the project gains traction is to move the Docker build/push/service update into CI space. We've moved away from ansible now largely, there's a use case for more complex setups for sure but am interested in K8 capabilities to help there.

hangtwenty#
Agree with your tips, I’m personally hoping EKS becomes good enough that we can just skip the ECS step, but honestly translating basic ECS to Compose to Kubernetes (or any variation on that) is all all easy, so any of them work great to start
jsmeaton3 replies#
May I ask how you’re managing secrets with this setup? For example, the secret key or database URL.

Our current setup deploys an env file which is sourced before starting the process. I’m less sure how this translates to a production docket deployment.

slow_donkey1 reply#
Docker shouldn't affect your secrets management because secrets shouldn't be baked into your image anyways. I tend to expose them as environment vars and currently use Kubernetes to expose a keyvault url/password so the app can automatically grab all the secrets
jsmeaton#
We manage them with env vars now. But we use salt (encrypted) to deploy a secrets file onto the server which is sourced before the app is started. With something like ECS I didn’t know if you could feed it an env file, and if you could, how you could make it available.
jsmeaton#
Thanks, exactly what I was looking for.
WiseWeasel#
I've only been using Docker/ECS on side projects, but I generate the production build Docker image with the production .env included, push it to a private repo on Amazon ECR, then pull it in to ECS from there.

My understanding is the best practice for Docker/ECS production deployment is to create Docker images containing the full app build, rather than managing the app deployment separately from image deployment. As opposed to development Docker images that rely on docker-compose to mount the host filesystem in the Docker container, the production image Dockerfile includes COPY instructions for the production build files, to be included in the image.

csytan#
Python3 + tornado + peewee + sqlite3 + vuejs hosted on Digital Ocean.

I've been using this combo in production for https://www.cozycal.com for a year with no problems.
Likes: - More control than hosted environments - Dirt cheap
Dislikes: - More responsibility than hosted environments

Load more comments