author = "relaxed"
app_name = "rw"
container_name = "rw"

all: container

# for dev
dev_image:
	# cd ./docker_dev
	sudo docker build --no-cache -t rasp_web/dev_mode ./docker_dev
	# cd ..

dev_amd_image:
	# cd ./docker_dev
	sudo docker build --platform linux/amd64 --no-cache -t rasp_web/dev_mode ./docker_dev
	# cd ..

dev_container:
	sudo docker run -d -p 80:80 --name rasp_web_dev_mode rasp_web/dev_mode

dev_stop:
	- sudo docker stop rasp_web_dev_mode
	- sudo docker rm rasp_web_dev_mode

# for app
image:
	sudo docker build --no-cache -t $(author)/$(app_name) .

amd_image:
	sudo docker build --platform linux/amd64 --no-cache -t $(author)/$(app_name) .

container:
	sudo docker run -d -p 80:80 --name $(container_name) $(author)/$(app_name)

stop:
	- sudo docker stop $(container_name) 
	- sudo docker rm $(container_name) 

export:
	sudo docker save $(author)/$(app_name) > $(author).$(app_name).tar
