Skip to content
Snippets Groups Projects
Commit e75dbf30 authored by Leah Tacke genannt Unterberg's avatar Leah Tacke genannt Unterberg
Browse files

cleaning up environment variable configuration

parent cf34c4b5
No related branches found
No related tags found
No related merge requests found
Pipeline #480400 passed
API_PREFIX=/api
API_BASE=backend
API_PORT=8080
API_PREFIX=/api
FRONTEND_PORT=8090
VITE_FRONTEND_PORT=$FRONTEND_PORT
VITE_API_PREFIX=$API_PREFIX
......
......@@ -10,14 +10,16 @@ RUN npm run build -- --mode production
FROM nginx:stable-alpine AS production-stage
ARG FRONTEND_PORT=8090
ARG API_PORT=8080
ARG API_BASE=backend
ARG API_PREFIX=/api
ENV FRONTEND_PORT=$FRONTEND_PORT
ENV API_BASE=$API_BASE
ENV API_PORT=$API_PORT
ENV API_PREFIX=$API_PREFIX
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf.template /etc/nginx/conf.d/default.conf.template
RUN envsubst '\$API_PORT \$FRONTEND_PORT \$API_PREFIX' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
RUN envsubst '\$API_BASE \$API_PORT \$FRONTEND_PORT \$API_PREFIX' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
RUN cat /etc/nginx/conf.d/default.conf
EXPOSE $FRONTEND_PORT
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
upstream api {
server backend:${API_PORT};
server ${API_BASE}:${API_PORT};
}
server {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment