Skip to content

Commit 45863f6

Browse files
committed
Fix permissions; add dev docker image
The `Dockerfile.dev` runs the vite dev server instead
1 parent a246505 commit 45863f6

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ COPY src /app/src
2323
# Run build
2424
ENV NODE_ENV=production
2525
RUN npm run build
26+
RUN find /app/dist -type f -print0 | xargs -0 chmod 644
27+
RUN find /app/dist -type d -print0 | xargs -0 chmod 755
2628

2729
# Stage 2: nginx
2830
# This copies built assets from previous stage

Dockerfile.dev

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM node:22 AS node-build
2+
WORKDIR /app
3+
4+
# Install packages first; need to install here to be cached in earlier layer
5+
# and not trigger re-compiles if only source code changes
6+
COPY package.json package-lock.json /app/
7+
RUN npm ci
8+
9+
# Copy the source code into the container
10+
COPY \
11+
.browserslistrc \
12+
.nvmrc \
13+
.editorconfig \
14+
jsconfig.json \
15+
vite.config.mjs \
16+
index.html \
17+
/app/
18+
19+
COPY public /app/public
20+
COPY src /app/src
21+
22+
LABEL org.label-schema.name="colocus-ui"
23+
LABEL org.label-schema.description="Development image for Colocus UI"
24+
LABEL org.label-schema.vendor="University of Michigan, Center for Statistical Genetics"
25+
LABEL org.label-schema.url="https://github.com/statgen/colocus-ui-vue3"
26+
LABEL org.label-schema.usage="https://github.com/statgen/colocus-ui-vue3#docker"
27+
LABEL org.label-schema.vcs-url="https://github.com/statgen/colocus-ui-vue3"
28+
LABEL org.label-schema.schema-version="1.0"
29+
30+
ARG BUILD_DATE
31+
ARG GIT_SHA
32+
ARG COLOCUS_UI_VERSION
33+
34+
LABEL org.label-schema.version=$COLOCUS_UI_VERSION \
35+
org.label-schema.vcs-ref=$GIT_SHA \
36+
org.label-schema.build-date=$BUILD_DATE
37+
38+
CMD ["sh", "-c", "node --no-warnings ./node_modules/.bin/vite --host 0.0.0.0 --port ${VITE_PORT:-5173} --strictPort"]

0 commit comments

Comments
 (0)