-
Hi there, I am trying build an app with Remix + Remix PWA
I could not see a clear guide on remix.config.js /** @type {import('@remix-pwa/dev').WorkerConfig} */
module.exports = {
appDirectory: "app",
assetsBuildDirectory: "public/build",
future: {
/* any enabled future flags */
},
ignoredRouteFiles: ["**/*.css"],
publicPath: "/build/",
serverBuildPath: "build/index.js",
// for Remix PWA
entryWorkerFile: '<appDir>/entry.worker.ts',
worker: '@remix-pwa/worker-runtime',
workerName: 'entry.worker',
}; package.json {
"name": "my-app",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"build": "run-s build:*",
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"start": "remix-serve ./build/server/index.js",
"typecheck": "tsc",
"build:remix": "remix build",
"build:worker": "remix-pwa build",
"dev": "run-p dev:*",
"dev:remix": "remix vite:dev",
"dev:worker": "remix-pwa dev"
},
"dependencies": {
"@remix-pwa/cache": "^2.0.12",
"@remix-pwa/client": "^2.0.1",
"@remix-pwa/push": "^1.0.9",
"@remix-pwa/strategy": "^2.1.9",
"@remix-pwa/sw": "^2.1.12",
"@remix-pwa/sync": "^2.0.1",
"@remix-run/node": "^2.8.0",
"@remix-run/react": "^2.8.0",
"@remix-run/serve": "^2.8.0",
"dotenv": "^16.3.1",
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@flydotio/dockerfile": "^0.5.2",
"@remix-pwa/dev": "2.0.31",
"@remix-pwa/worker-runtime": "^2.0.8",
"@remix-run/dev": "^2.8.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint": "^8.38.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"glob": "^10.3.10",
"npm-run-all": "^4.1.5",
"remix-pwa": "^3.0.19",
"typescript": "^5.1.6",
"vite": "^5.1.0",
"vite-tsconfig-paths": "^4.2.1"
},
"engines": {
"node": ">=18.0.0"
}
} Dockerfile # syntax = docker/dockerfile:1
# Adjust NODE_VERSION as desired
ARG NODE_VERSION=20.11.0
FROM node:${NODE_VERSION}-slim as base
LABEL fly_launch_runtime="Remix"
# Remix app lives here
WORKDIR /app
# Set production environment
ENV NODE_ENV="production"
# Install pnpm
ARG PNPM_VERSION=8.15.4
RUN npm install -g pnpm@$PNPM_VERSION
# Throw-away build stage to reduce size of final image
FROM base as build
# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
# Install node modules
COPY --link package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --prod=false
# Copy application code
COPY --link . .
# Build application
RUN pnpm run build
# Remove development dependencies
RUN pnpm prune --prod
# Final stage for app image
FROM base
# Copy built application
COPY --from=build /app /app
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "pnpm", "run", "start" ]
|
Beta Was this translation helpful? Give feedback.
Answered by
tonyltf
Mar 7, 2024
Replies: 2 comments 1 reply
-
Then I changed the package.json script to
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Found solution here |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tonyltf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found solution here
remix-pwa/monorepo#112