Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emrd/docker-import-tar-file
https://github.com/emrd/docker-import-tar-file
composer containerization docker
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/emrd/docker-import-tar-file
- Owner: EmrD
- Created: 2024-07-30T13:14:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T13:24:00.000Z (6 months ago)
- Last Synced: 2024-11-09T02:47:29.667Z (2 months ago)
- Topics: composer, containerization, docker
- Language: Nix
- Homepage:
- Size: 16.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
# React + Vite - Docker Usage
## Transferring to This Production Environment
The above steps will create a file named `my-app.tar`. This file allows you to move your Docker image to another production environment.
1. **Transfer the Tar File**
Transfer the `my-app.tar` file to your new production environment (e.g., another server). You can use methods such as SCP, FTP, or any other file transfer tool.
2. **Load the Docker Image in the New Environment**
On the new production environment, load the Docker image from the tar file:
```bash
docker load -i my-app.tar
```3. **Run the Docker Image**
Once the image is loaded, you can run it. The following command will start the container and map port `80` of the host to port `80` of the container:
```bash
docker run -p 80:80 my-app:latest
```## Notes
- **Dockerfile**: Make sure a Dockerfile is present in your project's root directory, defining how the application should be built.
- **Port Configuration**: The `-p` parameter in the `docker run` command binds the host port to the container port. Adjust this parameter based on the ports your application uses.---
This README file provides a step-by-step guide on Docker usage and transferring your project to a new environment, making it easier to manage and deploy your application.