Add individual docker run commands
This commit is contained in:
@ -1,19 +1,3 @@
|
||||
.PHONY: compose-build
|
||||
compose-build:
|
||||
docker compose build
|
||||
|
||||
.PHONY: compose-up
|
||||
compose-up:
|
||||
docker compose up
|
||||
|
||||
.PHONY: compose-up-build
|
||||
compose-up-build:
|
||||
docker compose up --build
|
||||
|
||||
.PHONY: compose-down
|
||||
compose-down:
|
||||
docker compose down
|
||||
|
||||
.PHONY: build-sample
|
||||
build-sample:
|
||||
DOCKER_BUILDKIT=1 docker build \
|
||||
@ -35,24 +19,6 @@ build-multiarch:
|
||||
--push \
|
||||
.
|
||||
|
||||
define ENTRYPOINT_CMD_DESCRIPTION
|
||||
##############################
|
||||
|
||||
See Dockerfile.sample for image definition.
|
||||
|
||||
This series of docker run commands is meant
|
||||
to help you understand the interaction between
|
||||
CMD and ENTRYPOINT.
|
||||
|
||||
The image has the following:
|
||||
|
||||
ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ]
|
||||
CMD [ "+ (cmd)" ]
|
||||
|
||||
##############################
|
||||
endef
|
||||
export ENTRYPOINT_CMD_DESCRIPTION
|
||||
|
||||
.PHONY: run-sample-entrypoint-cmd
|
||||
run-sample-entrypoint-cmd: build-sample
|
||||
@echo "$$ENTRYPOINT_CMD_DESCRIPTION"
|
||||
@ -70,4 +36,24 @@ run-sample-entrypoint-cmd: build-sample
|
||||
|
||||
@echo "##############################"
|
||||
@echo "Overriden entrypoint with arguments (CMD is ignored):"
|
||||
docker run --entrypoint echo sample "Hey Team 👋 (Overriden entrypoint + arguments)"
|
||||
docker run --entrypoint echo sample "Hey Team 👋 (Overriden entrypoint + arguments)"
|
||||
|
||||
define ENTRYPOINT_CMD_DESCRIPTION
|
||||
|
||||
✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅
|
||||
|
||||
See Dockerfile.sample for image definition.
|
||||
|
||||
This series of docker run commands is meant
|
||||
to help you understand the interaction between
|
||||
CMD and ENTRYPOINT.
|
||||
|
||||
The image has the following:
|
||||
|
||||
ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ]
|
||||
CMD [ "+ (cmd)" ]
|
||||
|
||||
✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅
|
||||
|
||||
endef
|
||||
export ENTRYPOINT_CMD_DESCRIPTION
|
||||
@ -1,3 +1,5 @@
|
||||
# syntax=docker/dockerfile:1.5
|
||||
|
||||
FROM node:19.4-bullseye AS build
|
||||
|
||||
# Specify working directory other than /
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import dns from 'dns';
|
||||
|
||||
dns.setDefaultResultOrder('verbatim');
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api/golang': {
|
||||
// TODO: Make this inside and outside of docker (e.g. localhost vs api-golang)
|
||||
target: 'http://api-golang:8080',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/golang/, ''),
|
||||
secure: false,
|
||||
},
|
||||
'/api/node': {
|
||||
// TODO: Make this inside and outside of docker (e.g. localhost vs api-node)
|
||||
target: 'http://api-node:3000',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/node/, ''),
|
||||
secure: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -1,48 +0,0 @@
|
||||
services:
|
||||
client-react:
|
||||
build:
|
||||
context: ../05-example-web-application/client-react/
|
||||
dockerfile: ../../06-building-container-images/client-react/Dockerfile.3
|
||||
ports:
|
||||
- 5173:5173
|
||||
volumes:
|
||||
- ${PWD}/client-react/vite.config.js:/usr/src/app/vite.config.js
|
||||
restart: unless-stopped
|
||||
client-react-nginx:
|
||||
build:
|
||||
context: ../05-example-web-application/client-react/
|
||||
dockerfile: ../../06-building-container-images/client-react/Dockerfile.4
|
||||
init: true
|
||||
ports:
|
||||
- 5174:80
|
||||
restart: unless-stopped
|
||||
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
|
||||
ports:
|
||||
- 3000:3000
|
||||
restart: unless-stopped
|
||||
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
|
||||
ports:
|
||||
- 8080:8080
|
||||
restart: unless-stopped
|
||||
db:
|
||||
image: postgres:15.1-alpine
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=foobarbaz
|
||||
ports:
|
||||
- 5432:5432
|
||||
Reference in New Issue
Block a user