fix: Use PORT environment variable (default 80) for Easypanel

This commit is contained in:
Kunthawat Greethong
2026-03-03 10:34:31 +07:00
parent 0fc4648dc6
commit b9d053283f

View File

@@ -15,8 +15,8 @@ COPY . .
# Build Astro project (includes public folder in dist)
RUN npm run build
# Expose port
EXPOSE 4321
# Expose port from environment variable (default 80 for Easypanel)
EXPOSE ${PORT:-80}
# Start Astro preview server
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "4321"]
# Start Astro preview server on the correct port
CMD ["sh", "-c", "npm run preview -- --host 0.0.0.0 --port ${PORT:-80}"]