Skip to content

dubniczky/Server-Deployments

Repository files navigation

Server Deployments

Server deployment containers for different frameworks

Disclaimer

These container images are not "final". They serve as a base to start out and in most cases work as-is with your project for quick testing.

Please read the Docker documentation and set up certificates before deploying these containers.

Frameworks

Version: lastest release of framework where the deployment was tested. It might require modifications in later versions.

Framework Version Stages Tags
Angular v13.3 2 angular, nginx, nodejs, ts, html, yarn, npm, npx
Apache v2.4 1 apache, static, html, css, php, js
DotNET v6.0 2 dotnet, c#, nuget, core
FastAPI v3.10 1 python, python3, pip, fastapi, uvicorn
Go v1.18.2 2 go, golang, mux, alpine
Laravel v9.1.8 1 php, laravel, artisan, composer, npm
Nginx v1.21 1 nginx, js, static, html, css
NodeJS v16.15.0 LTS 1 nodejs, js, yarn, npm, npx, pnpm, pm2
React v18.1.0 2 react, nginx, nodejs, js, html, yarn, npm, npx

Contents

Each deployment has the following structure. You may not need all the files.

/name

  • /Dockerfile - Commands to build a container
  • /.dockerignore - List of files and folders not to copy into the container
  • /compose.yml - Instructions for docker-compose on how to host the container(s)

Usage

1. Move to project

Move the Dockerfile and .dockerignore files into your project root.

2. Update ignore

Update .dockerignore to ignore everything you will not need for your deployment. Ideally, you should ignore:

  • Everything that's in your .gitignore
  • Git folder (.git/)
  • Build files and binaries
  • Caches
  • Installed packages
  • Tests (and their config)
  • Logs
  • Readme files and licenses
  • IDE specific files
  • Docker specific files
  • etc...

As a rule of thumb, consider every file you deploy to be accessible for attackers in a breach, so remove all secret information, even after running the application (like a .env file with login details).

3. Check Dockerfile

Check if the current Dockerfile settings work with your project. Some Dockerfiles contain multiple methods for package management. Checklist:

  • Exposed ports
  • Package manager
  • Included necessary files
  • Correct entry point

4. Build the container

Build the container with the given name and tag. The tag can be a version or a subtype of your project, like wip.

This command may require you to have administrator privileges

docker build -t <name>:<tag> .

5. Run the container locally

Run the container and expose the given ports. Docker can forward those ports to another external one.

This command may require you to have administrator privileges

docker run -p<port_ext>:<port_int> <name>:<tag>

Test the container to see if it's working and available from your browser.

6. Deploy your container

Deploy to the provider of your choice. This step may be different for each provider, so seek further instruction in their documentation.

Compose

Each deployment also contains a docker-compose description YAML file (compose.yml). For local usage or quick startup you may use it like so:

Build container:

docker-compose build

Start container:

docker-compose up

Build then start each time:

docker-compose up --build

LICENSE

General MIT license: view

About

Server deployment containers for specific frameworks

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project