Skip to content

Commit

Permalink
Update docker related files
Browse files Browse the repository at this point in the history
  • Loading branch information
JensForstmann committed Sep 20, 2024
1 parent cf33c37 commit b9a92ee
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20 AS BACKEND_BUILD_IMAGE
FROM node:20 AS backend_build_image
WORKDIR /app/backend
COPY backend/package-lock.json .
COPY backend/package.json .
Expand All @@ -10,7 +10,7 @@ COPY backend/tsoa.json .
RUN npm run build
RUN npm prune --production

FROM node:20 AS FRONTEND_BUILD_IMAGE
FROM node:20 AS frontend_build_image
WORKDIR /app/frontend
COPY frontend/package-lock.json .
COPY frontend/package.json .
Expand All @@ -25,10 +25,10 @@ COPY frontend/vite.config.mts .
RUN npm run build

FROM node:20
COPY --from=BACKEND_BUILD_IMAGE /app/backend/package.json /app/backend/swagger.json /app/backend/
COPY --from=BACKEND_BUILD_IMAGE /app/backend/dist /app/backend/dist
COPY --from=BACKEND_BUILD_IMAGE /app/backend/node_modules /app/backend/node_modules
COPY --from=FRONTEND_BUILD_IMAGE /app/frontend/dist /app/frontend/dist
COPY --from=backend_build_image /app/backend/package.json /app/backend/swagger.json /app/backend/
COPY --from=backend_build_image /app/backend/dist /app/backend/dist
COPY --from=backend_build_image /app/backend/node_modules /app/backend/node_modules
COPY --from=frontend_build_image /app/frontend/dist /app/frontend/dist
VOLUME /app/backend/storage
EXPOSE 8080
ARG COMMIT_SHA
Expand Down
2 changes: 1 addition & 1 deletion dev-container-init.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Set-Location $PSScriptRoot

docker run --rm -it -v .:/app node:20-alpine sh -c "cd /app && npm install && cd /app/backend && npm install && cd /app/frontend && npm install && mkdir -p /app/frontend/dist"
docker run --rm -it -v .:/app node:20 sh -c "cd /app && npm install && cd /app/backend && npm install && cd /app/frontend && npm install && mkdir -p /app/frontend/dist"
2 changes: 1 addition & 1 deletion dev-container-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

cd "$(dirname "$0")"

docker run --rm -it -v .:/app node:20-alpine sh -c "cd /app && npm install && cd /app/backend && npm install && cd /app/frontend && npm install && mkdir -p /app/frontend/dist"
docker run --rm -it -v .:/app node:20 sh -c "cd /app && npm install && cd /app/backend && npm install && cd /app/frontend && npm install && mkdir -p /app/frontend/dist"
2 changes: 1 addition & 1 deletion dev-container-start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Set-Location $PSScriptRoot
$TMT_PORT_BACKEND = $env:TMT_PORT_BACKEND ?? 8080
$TMT_PORT_FRONTEND = $env:TMT_PORT_FRONTEND ?? 5173

docker run --rm -it -v .:/app -p ${TMT_PORT_BACKEND}:8080 -p ${TMT_PORT_FRONTEND}:5173 node:20-alpine sh -c "cd /app/frontend && npm run dev & cd /app/backend && npm run dev"
docker run --rm -it -v .:/app -p ${TMT_PORT_BACKEND}:8080 -p ${TMT_PORT_FRONTEND}:5173 node:20 sh -c "cd /app/frontend && npm run dev & cd /app/backend && npm run dev"
2 changes: 1 addition & 1 deletion dev-container-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ cd "$(dirname "$0")"
TMT_PORT_BACKEND="${TMT_PORT_BACKEND:-8080}"
TMT_PORT_FRONTEND="${TMT_PORT_FRONTEND:-5173}"

docker run --rm -it -v .:/app -p $TMT_PORT_BACKEND:8080 -p $TMT_PORT_FRONTEND:5173 node:20-alpine sh -c "cd /app/frontend && npm run dev & cd /app/backend && npm run dev"
docker run --rm -it -v .:/app -p $TMT_PORT_BACKEND:8080 -p $TMT_PORT_FRONTEND:5173 node:20 sh -c "cd /app/frontend && npm run dev & cd /app/backend && npm run dev"

0 comments on commit b9a92ee

Please sign in to comment.