diff --git a/docker/Caddyfile b/docker/Caddyfile new file mode 100644 index 0000000..0679b59 --- /dev/null +++ b/docker/Caddyfile @@ -0,0 +1,6 @@ +:80 { + root * /var/www/html + file_server + + try_files {path} /index.html +} diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..8ab3527 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,21 @@ +FROM node:21.6 AS build-stage + +WORKDIR /app + +COPY package.json ./ + +RUN npm install + +COPY node_modules/ node_modules/ +COPY src/ src/ +COPY public/ public/ +COPY babel.config.js ./ +COPY jsconfig.json ./ +COPY vue.config.js ./ + +RUN npm run build + + +FROM caddy:2.8 AS production-stage + +COPY --from=build-stage /app/dist /var/www/html diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..9e5b94e --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,12 @@ +name: volleyball-site + +services: + vue-app: + build: + context: ../ + dockerfile: docker/Dockerfile + ports: + - "7000:80" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro + restart: unless-stopped