Skip to content

Commit

Permalink
[MOD] Refactor server and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarrc committed Mar 20, 2024
1 parent 23fee2b commit 9ea242c
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/server-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
server
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -23,7 +26,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
context: "{{defaultContext}}:server"
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ github.ref_name }}
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions dockerfile → server/dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM node:20.11.0-alpine3.18
WORKDIR /home/node
USER node
COPY --chown=node:node server server
COPY --chown=node:node tf tf
COPY --chown=node:node * server
WORKDIR /home/node/server
RUN npm install
EXPOSE 8080
Expand Down
2 changes: 1 addition & 1 deletion server/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Router = () => {
router.get("/chat", ChatController.count.bind(ChatController))
.post("/chat", ChatController.find.bind(ChatController))

router.use('/tf', express.static(join(__dirname, "../../tf")))
router.use('/tf', express.static(join(__dirname, "./tf")))

return router;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9ea242c

Please sign in to comment.