From 2d0cb51e97ccadfb2879c04f96b164d6be1d5d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20van=20Asperen?= Date: Thu, 9 May 2024 00:38:50 +0200 Subject: [PATCH] Streamline Makefile, making local_art directory a volume mount instead of a COPY --- .dockerignore | 3 +++ Dockerfile | 1 - Makefile | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index cd74655e..88d9f11f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,6 +17,9 @@ dev/* /.idea /.git +# volume mounts +local_art + # misc .DS_Store .env.local diff --git a/Dockerfile b/Dockerfile index 0216fe5a..613a8001 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 - diff --git a/Makefile b/Makefile index 5475649e..dda72031 100644 --- a/Makefile +++ b/Makefile @@ -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