This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (57 loc) · 1.88 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# syntax=docker/dockerfile:1
# # build
# FROM node:18-slim AS build
# RUN mkdir /app && chown -R node:node /app
# WORKDIR /app
# USER node
# COPY --chown=node:node . .
# # COPY --chown=node:node package.json package-lock.json .npmrc ./
# # COPY --chown=node:node tsconfig.json tailwind.config.cjs ./
# # COPY --chown=node:node vite.config.ts ./
# # COPY --chown=node:node index.html ./
# # #COPY --chown=node:node scripts ./scripts
# # #COPY --chown=node:node config ./config
# # #COPY --chown=node:node public ./public
# # COPY --chown=node:node src ./src
# RUN npm install --ci --no-audit --no-fund
# ENV NODE_ENV=production
# ARG VITE_APP_API_BASE_URL
# ARG VITE_APP_BASE_URL
# #ARG VITE_APP_MATOMO_BASE_URL
# #ARG VITE_APP_MATOMO_ID
# #ARG VITE_APP_REDMINE_ID
# #COPY --chown=node:node . .
# RUN npm run build-only
# #serve
# # FROM node:18-slim AS serve
# # RUN mkdir /app && chown -R node:node /app
# # WORKDIR /app
# # USER node
# # COPY --from=build --chown=node:node /app/.dir ./
# # ENV NODE_ENV=production
# EXPOSE 3000
# CMD ["npm", "run", "preview"]
# Use an official Node.js runtime as a parent image
FROM node:18
# default node 16 verwenden
# ARG APIS_API_KEY
# ARG TYPESENSE_API_KEY
# Set the working directory to /app
WORKDIR /app/
# SHELL ["/bin/bash", "-c"]
# Copy the package.json and package-lock.json files to the container
COPY package*.json /app
# Install dependencies
RUN npm install
# RUN npm install --ci --no-audit --no-fund
# Copy the rest of the application files to the container
COPY . /app
# TODO: exclude .env file here and construct it from build env args, if they start with "VITE_" and create the .env file from there
# Build the application with Vite
RUN npm run build-only
# npm run build-only
ENV NODE_ENV=production
# Expose port 3000 for the server to listen on
EXPOSE 3000
# Set the command to run when the container starts
CMD ["npm", "run", "preview"]