forked from github/plane
fix: docker setup (#987)
* removing dependencies from .env * dev: Passing the arguments from docker compose to DockerWeb in nextjs to define base environment variables * dev: removed env from docker-compose and taking the env from shell * dev: Updated docker file and used console in signin to test the env from docker * dev: Docker setting env variables via shell * removed env variables and args * Update Dockerfile.web * Update Dockerfile.web * Update signin.tsx * . * . * dev: Added BASE_URL from docker * dev: Updated docker config * dev: scripts for replacing variable during runtime * dev: entrypoint script * dev: update replace env script and update docker entrypoint command for frontend * dev: update replace env script to not update process.env * dev: update docker file to add missing variables as well * fix: updated docker compose yml and web * dev: create start script to run docker and update script for replacing variables * dev: update setup script and env example script to create variables in the root of the project * . * dev: update docker compose hub * dev: update docker compose hub command * dev: update docker compose yml and env example * dev: update docker compose hub * dev: single docker --------- Co-authored-by: Narayana <narayana.vadapalli1996@gmail.com> Co-authored-by: gurusainath <gurusainath007@gmail.com>
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -3,6 +3,7 @@ RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER
|
||||
|
||||
RUN yarn global add turbo
|
||||
COPY . .
|
||||
@@ -16,7 +17,7 @@ FROM node:18-alpine AS installer
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
WORKDIR /app
|
||||
|
||||
ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
|
||||
# First install the dependencies (as they change less often)
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
@@ -26,9 +27,16 @@ RUN yarn install
|
||||
# Build the project
|
||||
COPY --from=builder /app/out/full/ .
|
||||
COPY turbo.json turbo.json
|
||||
COPY replace-env-vars.sh /usr/local/bin/
|
||||
USER root
|
||||
RUN chmod +x /usr/local/bin/replace-env-vars.sh
|
||||
|
||||
RUN yarn turbo run build --filter=app
|
||||
|
||||
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \
|
||||
BUILT_NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL
|
||||
|
||||
RUN /usr/local/bin/replace-env-vars.sh http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER ${NEXT_PUBLIC_WEBAPP_URL}
|
||||
|
||||
FROM python:3.11.1-alpine3.17 AS backend
|
||||
|
||||
@@ -108,6 +116,16 @@ COPY nginx/nginx-single-docker-image.conf /etc/nginx/http.d/default.conf
|
||||
|
||||
COPY nginx/supervisor.conf /code/supervisor.conf
|
||||
|
||||
ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
|
||||
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \
|
||||
BUILT_NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL
|
||||
|
||||
USER root
|
||||
COPY replace-env-vars.sh /usr/local/bin/
|
||||
COPY start.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/replace-env-vars.sh
|
||||
RUN chmod +x /usr/local/bin/start.sh
|
||||
|
||||
|
||||
CMD ["supervisord","-c","/code/supervisor.conf"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user