first commit

This commit is contained in:
mahmood
2025-07-22 23:04:56 +03:30
commit 0c518d3c22
3 changed files with 51 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
FROM node:20
WORKDIR /app
COPY . .
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Environment replacement process
ENTRYPOINT ["/entrypoint.sh"]
ENV PORT=5200
EXPOSE 5200
CMD ["node", ".output/server/index.mjs"]
+13
View File
@@ -0,0 +1,13 @@
name: ssr-app
# dokploy.yml
build:
command: yarn install && yarn build
output_dir: .output
run:
command: node .output/server/index.mjs
port: 5050
env:
NODE_ENV: production
MY_CUSTOM_VAR: "value"
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh
# Function to escape special characters for sed
escape_sed() {
printf '%s\n' "$1" | sed -e 's/[\/&]/\\&/g' -e 's/\./\\\./g'
}
# Escape all URL variables
ESCAPED_SUPABASE_URL=$(escape_sed "$VITE_SUPABASE_URL")
ESCAPED_IMAGE_URL=$(escape_sed "$VITE_SUPABASE_BASE_IMAGE_URL")
ESCAPED_NODE_URL=$(escape_sed "$VITE_NODE_BASE_URL")
# Replace placeholders with escaped values
find /usr/share/nginx/html -type f \( -name "*.js" -o -name "*.html" \) -exec sed -i \
-e "s/__VITE_APP_TYPE__/${VITE_APP_TYPE}/g" \
-e "s/__VITE_APP_NAME_FA__/${VITE_APP_NAME_FA}/g" \
-e "s/__VITE_APP_NAME_EN__/${VITE_APP_NAME_EN}/g" \
-e "s/__VITE_SUPABASE_URL__/${ESCAPED_SUPABASE_URL}/g" \
-e "s/__VITE_SUPABASE_KEY__/${VITE_SUPABASE_KEY}/g" \
-e "s/__VITE_SUPABASE_BASE_IMAGE_URL__/${ESCAPED_IMAGE_URL}/g" \
-e "s/__VITE_NODE_BASE_URL__/${ESCAPED_NODE_URL}/g" \
{} \;
exec "$@"