Skip to content

Commit

Permalink
adding dockerfiles for zora
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed May 8, 2024
1 parent 64db979 commit 603e34c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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__/*
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
30 changes: 30 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 603e34c

Please sign in to comment.