Streamline Makefile, making local_art directory a volume mount instead of a COPY

This commit is contained in:
René van Asperen
2024-05-09 00:38:50 +02:00
parent 997d7d95a1
commit 2d0cb51e97
3 changed files with 21 additions and 2 deletions

View File

@@ -17,6 +17,9 @@ dev/*
/.idea
/.git
# volume mounts
local_art
# misc
.DS_Store
.env.local

View File

@@ -4,4 +4,3 @@ FROM nginx:1.21-alpine as prod
EXPOSE 4242
COPY . /usr/share/nginx/html/
COPY app.conf /etc/nginx/nginx.conf

View File

@@ -1,2 +1,19 @@
.PHONY: start stop
start:
docker build -f Dockerfile --target "prod" . -t "cardconjurer-client" && docker run -dit -h 127.0.0.1 -p 4242:4242 "cardconjurer-client"
docker build \
--file Dockerfile \
--target "prod" \
--tag "cardconjurer-client" \
. && \
docker run \
--detach \
--hostname 127.0.0.1 \
--publish 4242:4242 \
--name cardconjurer-client \
--volume ./:/usr/share/nginx/html/:ro \
"cardconjurer-client"
stop:
docker stop cardconjurer-client && \
docker rm cardconjurer-client