8000 GitHub - girish332/containers
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

girish332/containers

Repository files navigation

Containers Workshop

Objective

The Objective of this workshop is to create a Dockerfile for your webapp and run it alongside your database using Docker Compose

Instructions

  1. Install Docker on your local machine https://docs.docker.com/engine/install/

  2. The repository contains sample Docker files for an application

  3. Use the respective Dockerfile and modify it according to your application

  4. Build the docker image using the following command:

docker build -t <image-name> .
  1. Run the docker image using the following command to test the application locally:
# ensure to change the port mapping according to your application
# you can also use the --env-file flag to pass environment variables to the container
docker run --env-file .env -d -p 8080:8080 <image-name> 
  1. After testing the application locally, select a docker compose file and modify the environment variables according to your application

  2. Run the docker compose file using the following command:

docker-compose -f <docker-compose-file> up
  1. The Application should be running locally and it should be connected to your database running in a separate container

Docker CLI Commands Cheatsheet

https://docs.docker.com/get-started/docker_cheatsheet.pdf

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0