Skip to content

Commit

Permalink
Merge pull request #172 from prona-p4-learning-platform/171-package-l…
Browse files Browse the repository at this point in the history
…ock-dockerfile
  • Loading branch information
srieger1 authored Feb 10, 2024
2 parents 775e572 + c0cef0c commit f631e58
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Node modules
node_modules
frontend/node_modules
backend/node_modules

# Build folders
frontend/build
backend/dist
backend/static

# Workers
frontend/public/dist

npm-debug.log
.env.local
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ EXPOSE 3001/tcp
RUN useradd -m -s /bin/bash p4
WORKDIR /home/p4/learn-sdn-hub

# copy frontend and backend files to the image
# copy necessary files to image
COPY frontend frontend
COPY backend backend
COPY package.json .
COPY package-lock.json .

# build backend and frontend, create static backend
RUN cd backend && npm install && npm run compile
RUN cd frontend && npm install && npm run build && npm run create-static-backend
# build frontend and create static backend
RUN npm clean-install
RUN cd frontend && npm run build && npm run create-static-backend

# copy example startup script and use it as the entrypoint when running the container
COPY examples/start-learn-sdn-hub.sh start-learn-sdn-hub.sh
Expand Down

0 comments on commit f631e58

Please sign in to comment.