fix: add ARG and ENV to Dockerfile for build args, fix typo in .env.staging
This commit is contained in:
2
deploy/.env.production
Normal file
2
deploy/.env.production
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_API_IMPLEMENTATION=django
|
||||||
|
VITE_DJANGO_BASE_URL=http://donconfiao.sabatron.click:7000
|
||||||
2
deploy/.env.staging
Normal file
2
deploy/.env.staging
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_API_IMPLEMENTATION=django
|
||||||
|
VITE_DJANGO_BASE_URL=http://staging.api.donconfiao.sabatron.click:7000
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
# Stage 1: Build with Node.js
|
# Stage 1: Build with Node.js
|
||||||
FROM node:20-alpine AS builder
|
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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
@@ -13,7 +19,7 @@ RUN npm run build
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
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
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|||||||
|
|
||||||
GITEA_REGISTRY="gitea.onecluster.org"
|
GITEA_REGISTRY="gitea.onecluster.org"
|
||||||
GITEA_USER="mono"
|
GITEA_USER="mono"
|
||||||
IMAGE_NAME="don_confiao_frontend"
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 <staging|production> [commit_sha]"
|
echo "Usage: $0 <staging|production> [commit_sha]"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name _;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user