1

I got a task to care about a production server (Ubuntu 18.04 LTS, NGINX, Node.js, MYSQL). Beside backup (which is regular) I want to prepare as much as possible for quick migration (to nonexistent staging and development server and into new cloud server).

I was thinking about "dockerziation" of the running server. Is this possible? At least to some point?

JanezKranjski
  • 133
  • 1
  • 8

1 Answers1

0

dockerziation != virtualization, to put things in docker, make Dockerfile(s) for your app, generally one app per docker file (nginx,node,mysql seperate containers) with minimal os needs (ubi not Ubuntu).

nginx Dockerfile example

FROM nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf

then build it, and then run it.

docker build . -t myapp-nginx
docker run myapp-nginx

to hook it into other apps, setup a docker-compose file to create relations between apps and dependencies.

Jacob Evans
  • 7,886
  • 3
  • 29
  • 57
  • 1
    Thank you. Today I found next approach: https://juliensalinas.com/en/dockerize-whole-linux-server/ - this is similar to what I thought. – JanezKranjski Nov 16 '19 at 15:42
  • I actually wrote this blog post for this exact same situation. Glad it helped you :) – Julien Salinas Nov 29 '19 at 08:37
  • 1
    @JulienSalinas I too have the same need, and Julian, your article has helped tremendously. My case is a little different in that I cannot install docker on the server itself. I have to rsync to a remote computer. If you've experimented with that, can you offer some best-practices insight? – user658182 Sep 28 '22 at 08:00
  • Great to hear that it was useful @user658182! I don't have specific best practices in mind concerning rsync though.. – Julien Salinas Sep 28 '22 at 12:05