Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipyard demo #8

Open
wants to merge 5 commits into
base: shipyard-demo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 05-example-web-application/client-react/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function CurrentTime(props) {
export function App() {
return (
<QueryClientProvider client={queryClient}>
<h1>Hey Team! 👋</h1>
<h1>Hey Team from shipyard! 🚢</h1>
<CurrentTime api="/api/golang/"/>
<CurrentTime api="/api/node/"/>
<ReactQueryDevtools initialIsOpen={false} />
Expand Down
16 changes: 8 additions & 8 deletions 07-container-registries/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ build:
# https://docs.docker.com/engine/reference/commandline/login/
.PHONY: push-dockerhub
push-dockerhub:
docker tag my-scratch-image sidpalas/my-scratch-image # defaults to latest
docker push sidpalas/my-scratch-image
docker tag my-scratch-image megalodon25/my-scratch-image # defaults to latest
docker push megalodon25/my-scratch-image

docker tag my-scratch-image sidpalas/my-scratch-image:abc-123
docker push sidpalas/my-scratch-image:abc-123
docker tag my-scratch-image megalodon25/my-scratch-image:abc-123
docker push megalodon25/my-scratch-image:abc-123

# Have to authenticate to ghcr.io first
# https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry
.PHONY: push-github-packages
push-github-packages:
docker tag my-scratch-image ghcr.io/sidpalas/my-scratch-image # defaults to latest
docker push ghcr.io/sidpalas/my-scratch-image
docker tag my-scratch-image ghcr.io/megalodon25/my-scratch-image # defaults to latest
docker push ghcr.io/megalodon25/my-scratch-image

docker tag my-scratch-image ghcr.io/sidpalas/my-scratch-image:abc-123 # defaults to latest
docker push ghcr.io/sidpalas/my-scratch-image:abc-123
docker tag my-scratch-image ghcr.io/megalodon25/my-scratch-image:abc-123 # defaults to latest
docker push ghcr.io/megalodon25/my-scratch-image:abc-123
6 changes: 0 additions & 6 deletions 08-running-containers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ docker-run-all:
-e DATABASE_URL=${DATABASE_URL} \
-p 3000:3000 \
--restart unless-stopped \
--link=db \
api-node

docker run -d \
Expand All @@ -68,7 +67,6 @@ docker-run-all:
-e DATABASE_URL=${DATABASE_URL} \
-p 8080:8080 \
--restart unless-stopped \
--link=db \
api-golang

docker run -d \
Expand All @@ -77,17 +75,13 @@ docker-run-all:
-v ${PWD}/client-react/vite.config.js:/usr/src/app/vite.config.js \
-p 5173:5173 \
--restart unless-stopped \
--link=api-node \
--link=api-golang \
client-react-vite

docker run -d \
--name client-react-nginx \
--network my-network \
-p 80:8080 \
--restart unless-stopped \
--link=api-node \
--link=api-golang \
client-react-ngnix

.PHONY: docker-stop
Expand Down
80 changes: 80 additions & 0 deletions 11-development-workflow/api-node/docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
services:
client-react-vite:
image: client-react-vite
build:
context: ../05-example-web-application/client-react/
dockerfile: ../../06-building-container-images/client-react/Dockerfile.3
init: true
volumes:
- ./client-react/vite.config.js:/usr/src/app/vite.config.js
networks:
- frontend
ports:
- 5173:5173
client-react-nginx:
labels:
shipyard.primary-route: true
shipyard.route: '/'
image: client-react-nginx
build:
context: ../05-example-web-application/client-react/
dockerfile: ../../06-building-container-images/client-react/Dockerfile.5
init: true
networks:
- frontend
ports:
- 80:8080
restart: unless-stopped
api-node:
labels:
shipyard.route: '/api/node/'
shipyard.route.rewrite: true
image: api-node
build:
context: ../05-example-web-application/api-node/
dockerfile: ../../06-building-container-images/api-node/Dockerfile.7
init: true
depends_on:
- db
environment:
- DATABASE_URL=postgres://postgres:foobarbaz@db:5432/postgres
networks:
- frontend
- backend
ports:
- 3000:3000
restart: unless-stopped
api-golang:
labels:
shipyard.route: '/api/golang/'
shipyard.route.rewrite: true
image: api-golang
build:
context: ../05-example-web-application/api-golang/
dockerfile: ../../06-building-container-images/api-golang/Dockerfile.6
init: true
depends_on:
- db
environment:
- DATABASE_URL=postgres://postgres:foobarbaz@db:5432/postgres
networks:
- frontend
- backend
ports:
- 8080:8080
restart: unless-stopped
db:
image: postgres:15.1-alpine
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=foobarbaz
networks:
- backend
ports:
- 5432:5432
volumes:
pgdata:
networks:
frontend:
backend:
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# DevOps Directive Docker Course

**NOTE:** The course video will be released to YouTube in Spring 2023!
This is the companion repo to: [Complete Docker Course - From BEGINNER to PRO! (Learn Containers)](https://youtu.be/RqTEHSBrYFw)

This is the companion repo to: `<INSERT VIDEO LINK>`

`<INSERT THUMBNAIL IMAGE>`
[![](./readme-assets/thumbnail.jpg)](https://youtu.be/RqTEHSBrYFw)

## Sponsor

[![](./readme-assets/shipyard-logo.png)](https://shipyard.build)
[![](./readme-assets/shipyard-logo.png)](https://shipyard.build/)

Thank you to Shipyard for sponsoring this course. It is because of their support that I am able to provide it to the community free of charge!
Thank you to [Shipyard](https://shipyard.build/) for sponsoring this course! It is because of their support that I am able to provide it to the community free of charge!

Shipyard is the easiest way to generate on demand ephemeral environments (aka a new environment for every pull request). Check them out at https://shipyard.build/!
Shipyard is the easiest way to generate on demand ephemeral environments (aka a new environment for every pull request). Sign up today at https://shipyard.social/DevOpsDirectivePromo! The first 300 people to use the promo code "DEVOPSDIRECTIVE" will receive an additional 30 days free on either their startup or business tier plans!

## [01 - History and Motivation](01-history-and-motivation/README.md)

Expand All @@ -32,7 +30,7 @@ Before we build our own container images, we can familiarize ourselves with the

## [05 - Example Web Application](05-example-web-application/README.md)

Learning about containerization is interesting, but without a practical example it isn't very useful. In this section we create a 3 tier web application with a React front end client, two apis (node.js + golang), and a database. The application is as simple as possible while still providing a realistic microservice system to containerize.
Learning about containerization is interesting, but without a practical example it isn't very useful. In this section we create a 3 tier web application with a React front end client, two apis (node.js + golang), and a database. The application is as simple as possible while still providing a realistic microservice system to containerize.

## [06 - Building Container Images](06-building-container-images/README.md)

Expand Down
Binary file modified readme-assets/shipyard-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-assets/thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.