Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Latest commit

 

History

History
77 lines (51 loc) · 1.71 KB

File metadata and controls

77 lines (51 loc) · 1.71 KB

simple-react-app

The goal of this project is to familiarize myself with Docker.

Table of Contents

Development

Docker Build

docker build -f Dockerfile.dev -t learning-docker:local .

Docker Run

docker run -p 3000:3000 learning-docker:local

Docker Compose

docker-compose up

Testing With Docker

-it - lets us interact with the docker container (short hand for --interactive and --tty, which runs the docker container with pseudo terminal and stdin/stdout)

NOTE: this will not auto-update when you add, remove, or modify any tests. To get auto-updating tests, see Testing With Docker Compose.

docker run -it learning-docker:local npm test

Testing With Docker Compose

Docker Compose will create a new service (container) to run the tests and watch and auto-update when you add, remove, or modify any tests.

NOTE: we will no longer have interactivity with the test container... you may investigate changing the PID of the process of the docker container so you can docker attach to the test container

docker-compose up

Production

Multi-step Docker Builds

See Dockerfile

NGINX

Build

docker build -t learning-docker:prod .

Run

docker run -p 3000:80 learning-docker:prod