From 603e34c2cc731372e149f81f4fd18707b19236f2 Mon Sep 17 00:00:00 2001 From: havok2063 Date: Wed, 8 May 2024 14:07:27 -0400 Subject: [PATCH] adding dockerfiles for zora --- .dockerignore | 15 +++++++++++++++ Dockerfile | 28 ++++++++++++++++++++++++++++ Dockerfile.dev | 30 ++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Dockerfile.dev diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..82fc85d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +# Ignore node_modules directory +./zora/node_modules + +# Ignore build output directory +./zora/dist + +# Ignore development server files +.vite + +# Ignore git +./zora/.git +./zora/.github + +# Ignore tests +**/__test__/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..13090af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use an official Node.js runtime as the base image +FROM node:18-slim as build-stage + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json to the container +COPY zora/package*.json ./ + +# Install app dependencies +RUN npm install + +# Copy the rest of the application code to the container +COPY ./zora . + +# Copy the custom .env.docker file +COPY .env.docker .env.production + +# Build the Vue.js app +RUN npm run build + +# Set a label +LABEL org.opencontainers.image.source https://github.com/sdss/zora +LABEL org.opencontainers.image.description "zora production image" + +# Copy the files to mountable directory +RUN mkdir -p /app/html +CMD ["cp", "-r", "/app/dist/.", "/app/html"] \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..e784892 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,30 @@ +# Use an official Node.js runtime as the base image +FROM node:18-slim as dev-stage + +# Set a label +LABEL org.opencontainers.image.source https://github.com/sdss/zora_valis_dockers + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json to the container +COPY ./zora/package*.json ./ + +# Install app dependencies +RUN npm install + +# Copy the rest of the application code to the container +COPY ./zora . + +# Development environment +FROM dev-stage as build-stage + +# Set a label +LABEL org.opencontainers.image.source https://github.com/sdss/zora +LABEL org.opencontainers.image.description "zora development image" + +# Export port 3000 +EXPOSE 3000 + +# Build the Vue.js app with hot-reloading for dev +CMD ["npm", "run", "dev", "--host"]