mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-11 13:19:49 +02:00
fix dockerfile
This commit is contained in:
36
Dockerfile
36
Dockerfile
@@ -1,25 +1,19 @@
|
|||||||
# use the official Bun image
|
# Build stage
|
||||||
# see all versions at https://hub.docker.com/r/oven/bun/tags
|
FROM node:20-alpine AS builder
|
||||||
FROM oven/bun:1 AS build
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY ./website /app
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run generate
|
||||||
|
|
||||||
COPY website/package.json bun.lock* ./
|
# Serve stage
|
||||||
|
FROM nginx:alpine3.17-slim
|
||||||
|
|
||||||
# use ignore-scripts to avoid builting node modules like better-sqlite3
|
# Copy built files from Vite's dist folder
|
||||||
RUN bun install --frozen-lockfile --ignore-scripts
|
COPY --from=builder /app/.output/public /usr/share/nginx/html
|
||||||
|
#COPY --from=builder /app/tranga-website/media /usr/share/nginx/html/media
|
||||||
|
COPY ./nginx /etc/nginx
|
||||||
|
|
||||||
# Copy the entire project
|
EXPOSE 80
|
||||||
COPY website/* .
|
ENV API_URL=http://tranga-api:6531
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
RUN bun --bun run build
|
|
||||||
|
|
||||||
# copy production dependencies and source code into final image
|
|
||||||
FROM oven/bun:1 AS production
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Only `.output` folder is needed from the build stage
|
|
||||||
COPY --from=build /app/.output /app
|
|
||||||
|
|
||||||
# run the app
|
|
||||||
EXPOSE 3000/tcp
|
|
||||||
ENTRYPOINT [ "bun", "--bun", "run", "/app/server/index.mjs" ]
|
|
3
website/package-lock.json
generated
3
website/package-lock.json
generated
@@ -10790,7 +10790,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz",
|
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz",
|
||||||
"integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==",
|
"integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"detect-libc": "^2.0.3"
|
"detect-libc": "^2.0.3"
|
||||||
},
|
},
|
||||||
@@ -14690,7 +14689,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.4.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.4.tgz",
|
||||||
"integrity": "sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==",
|
"integrity": "sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/estree": "1.0.8"
|
"@types/estree": "1.0.8"
|
||||||
},
|
},
|
||||||
@@ -15865,6 +15863,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.44.0.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.44.0.tgz",
|
||||||
"integrity": "sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==",
|
"integrity": "sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jridgewell/source-map": "^0.3.3",
|
"@jridgewell/source-map": "^0.3.3",
|
||||||
"acorn": "^8.15.0",
|
"acorn": "^8.15.0",
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
"postinstall": "nuxt prepare",
|
"postinstall": "nuxt prepare",
|
||||||
"prettier": "prettier . --write",
|
"prettier": "prettier . --write",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"clean": "eslint . --fix && prettier . --write"
|
"clean": "eslint . --fix && prettier . --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/content": "^3.7.1",
|
"@nuxt/content": "^3.7.1",
|
||||||
|
Reference in New Issue
Block a user