Skip to content

Commit 9f22dc6

Browse files
committed
Production deployment updates
Nuxt 3 uses Nitro for deployment, which requires some changes. https://nuxt.com/docs/getting-started/deployment Also fixed a missing `argon2-cffi` production dependency for `passlib`.
1 parent ef62497 commit 9f22dc6

File tree

4 files changed

+71
-10
lines changed

4 files changed

+71
-10
lines changed

{{cookiecutter.project_slug}}/backend/app/poetry.lock

Lines changed: 60 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

{{cookiecutter.project_slug}}/backend/app/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ neo4j = "^5.3.0"
2424
neomodel = "^4.0.8"
2525
psycopg2-binary = "^2.9.5"
2626
setuptools = "^65.6.3"
27+
argon2-cffi = "^21.3.0"
2728

2829
[tool.poetry.dev-dependencies]
2930
mypy = "^0.991"

{{cookiecutter.project_slug}}/docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,12 @@ services:
266266
environment:
267267
- NUXT_HOST=0.0.0.0
268268
- NUXT_PORT=80
269+
- NITRO_HOST=0.0.0.0
270+
- NITRO_PORT=80
269271
build:
270272
context: ./frontend
271273
args:
272-
NUXT_VERSION: ${NUXT_VERSION:-^2.15}
274+
NUXT_VERSION: ${NUXT_VERSION:-^3.0}
273275
deploy:
274276
labels:
275277
- traefik.enable=true

{{cookiecutter.project_slug}}/frontend/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM node:16.18.1 AS build
2-
ENV NODE_ENV=development NUXT_HOST=${NUXT_HOST:-0.0.0.0} NUXT_PORT=${NUXT_PORT:-3000} NUXT_TELEMETRY_DISABLED=1
2+
ENV NODE_ENV=development NITRO_HOST=${NUXT_HOST:-0.0.0.0} NITRO_PORT=${NUXT_PORT:-3000} NUXT_TELEMETRY_DISABLED=1
33
COPY . /app
44
WORKDIR /app
55
RUN yarn install --frozen-lockfile --network-timeout 100000 --non-interactive
@@ -33,10 +33,12 @@ ARG VEE_VERSION=^4.7.3
3333
ARG VEE_INT_VERSION=^4.7.3
3434
ARG VEE_RULES_VERSION=^4.7.3
3535
ARG QR_CODE_VERSION=^3.3.3
36-
ENV NODE_ENV=production NUXT_HOST=${NUXT_HOST:-0.0.0.0} NUXT_PORT=${NUXT_PORT:-3000} NUXT_TELEMETRY_DISABLED=1
36+
ENV NODE_ENV=production NITRO_HOST=${NITRO_HOST:-0.0.0.0} NITRO_PORT=${NITRO_PORT:-80} NUXT_TELEMETRY_DISABLED=1
3737
WORKDIR /app
38-
RUN yarn add nuxt@${NUXT_VERSION} @nuxt/content@${NUXT_CONTENT_VERSION} tailwindcss@${TAILWINDCSS_VERSION} autoprefixer@${AUTOPREFIXER_VERSION} postcss@${POSTCSS_VERSION} @tailwindcss/aspect-ratio@${ASPECT_RATIO_VERSION} @tailwindcss/forms@${FORMS_VERSION} @tailwindcss/line-clamp@${LINE_CLAMP_VERSION} @tailwindcss/typography@${TYPOGRAPHY_VERSION} @headlessui/vue@${HEADLESSUI_VERSION} @heroicons/vue@${HEROICONS_VERSION} @pinia/nuxt@${PINIA_VERSION} @pinia-plugin-persistedstate/nuxt${PINIA_PERSISTED_VERSION} vee-validate@${VEE_VERSION} @vee-validate/i18n${VEE_INT_VERSION} @vee-validate/rules${VEE_RULES_VERSION} qrcode.vue${QR_CODE_VERSION}
38+
RUN yarn add nuxt@${NUXT_VERSION} @nuxt/content@${NUXT_CONTENT_VERSION} tailwindcss@${TAILWINDCSS_VERSION} autoprefixer@${AUTOPREFIXER_VERSION} postcss@${POSTCSS_VERSION} @tailwindcss/aspect-ratio@${ASPECT_RATIO_VERSION} @tailwindcss/forms@${FORMS_VERSION} @tailwindcss/line-clamp@${LINE_CLAMP_VERSION} @tailwindcss/typography@${TYPOGRAPHY_VERSION} @headlessui/vue@${HEADLESSUI_VERSION} @heroicons/vue@${HEROICONS_VERSION} @pinia/nuxt@${PINIA_VERSION} @pinia-plugin-persistedstate/nuxt@${PINIA_PERSISTED_VERSION} vee-validate@${VEE_VERSION} @vee-validate/i18n@${VEE_INT_VERSION} @vee-validate/rules@${VEE_RULES_VERSION} qrcode.vue@${QR_CODE_VERSION}
3939
COPY --from=build /app/.nuxt ./.nuxt
40+
COPY --from=build /app/.output/ ./.output
41+
COPY --from=build /app/api ./api
4042
COPY --from=build /app/assets ./assets
4143
COPY --from=build /app/components ./components
4244
COPY --from=build /app/content ./content
@@ -45,13 +47,12 @@ COPY --from=build /app/layouts ./layouts
4547
COPY --from=build /app/middleware ./middleware
4648
COPY --from=build /app/pages ./pages
4749
COPY --from=build /app/plugins ./plugins
48-
COPY --from=build /app/static ./static
50+
COPY --from=build /app/public ./public
4951
COPY --from=build /app/stores ./stores
5052
COPY --from=build /app/utilities ./utilities
5153
COPY --from=build /app/.env ./
5254
COPY --from=build /app/app.vue ./
5355
COPY --from=build /app/nuxt.config* ./
5456
COPY --from=build /app/tailwind.config* ./
5557
COPY --from=build /app/tsconfig.json ./
56-
ENTRYPOINT ["yarn"]
57-
CMD ["nuxt-start"]
58+
CMD ["node", ".output/server/index.mjs"]

0 commit comments

Comments
 (0)