fix: add ARG and ENV to Dockerfile for build args, fix typo in .env.staging

This commit is contained in:
mono
2026-03-15 22:53:42 -05:00
parent 95a9a5cb1f
commit fa0bf07ad2
5 changed files with 12 additions and 3 deletions

2
deploy/.env.production Normal file
View File

@@ -0,0 +1,2 @@
VITE_API_IMPLEMENTATION=django
VITE_DJANGO_BASE_URL=http://donconfiao.sabatron.click:7000

2
deploy/.env.staging Normal file
View File

@@ -0,0 +1,2 @@
VITE_API_IMPLEMENTATION=django
VITE_DJANGO_BASE_URL=http://staging.api.donconfiao.sabatron.click:7000

View File

@@ -1,6 +1,12 @@
# Stage 1: Build with Node.js
FROM node:20-alpine AS builder
ARG VITE_DJANGO_BASE_URL
ARG VITE_API_IMPLEMENTATION
ENV VITE_DJANGO_BASE_URL=$VITE_DJANGO_BASE_URL
ENV VITE_API_IMPLEMENTATION=$VITE_API_IMPLEMENTATION
WORKDIR /app
COPY package.json package-lock.json ./
@@ -13,7 +19,7 @@ RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

View File

@@ -7,7 +7,6 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
GITEA_REGISTRY="gitea.onecluster.org"
GITEA_USER="mono"
IMAGE_NAME="don_confiao_frontend"
usage() {
echo "Usage: $0 <staging|production> [commit_sha]"

View File

@@ -1,6 +1,6 @@
server {
listen 80;
server_name localhost;
server_name _;
root /usr/share/nginx/html;
index index.html;