Skip to content

Commit

Permalink
fix(docker): resolve issues in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
naimulcsx committed Nov 19, 2024
1 parent 712e7b3 commit 4c08d3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ jobs:
cwd: './'
files: |
dist/apps/web/
apps/web/captain-definition
outPath: deploy.tar

- name: Deploy App to CapRover
- name: Deploy App
uses: caprover/deploy-from-github@v1.0.1
with:
server: '${{ secrets.CAPROVER_SERVER }}'
Expand Down
27 changes: 1 addition & 26 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,7 @@ FROM node:20.16.0-alpine
WORKDIR /app

# Copy build files
COPY build/client ./client
COPY build/server ./server

# Create server.js file
RUN echo "import { createRequestHandler } from '@remix-run/express'; \
import express from 'express'; \
import * as build from './server/index.js'; \
\
const app = express(); \
const port = process.env.PORT || 3380; \
\
app.use(express.static('./client')); \
\
app.all( \
'*', \
createRequestHandler({ \
build, \
}), \
); \
\
app.listen(port, () => { \
console.log(\`Server is running on port \${port}\`); \
});" > server.js

# Copy package files
COPY build/server/package.json ./
COPY . .

# Install production dependencies only
RUN npm install
Expand Down

0 comments on commit 4c08d3b

Please sign in to comment.