-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
165 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ jobs: | |
with: | ||
files_yaml: | | ||
base: | ||
- Dockerfile.base | ||
- aio/Dockerfile.base | ||
base_build_push: | ||
if: ${{ needs.base_build_setup.outputs.build_base == 'true' || github.event_name == 'workflow_dispatch' || needs.base_build_setup.outputs.gh_branch_name == 'master' }} | ||
|
@@ -69,7 +69,6 @@ jobs: | |
TAG=${{ env.BASE_IMG_TAG }} | ||
fi | ||
echo "BASE_IMG_TAG=${TAG}" >> $GITHUB_ENV | ||
mkdir -p ./no-use | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
|
@@ -87,8 +86,8 @@ jobs: | |
- name: Build and Push to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
context: ./no-use | ||
file: ./Dockerfile.base | ||
context: ./aio | ||
file: ./api/Dockerfile.base | ||
platforms: ${{ env.BUILDX_PLATFORMS }} | ||
tags: ${{ env.BASE_IMG_TAG }} | ||
push: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
FROM node:18-alpine AS builder | ||
RUN apk add --no-cache libc6-compat | ||
# Set working directory | ||
WORKDIR /app | ||
ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER | ||
|
||
RUN yarn global add turbo | ||
RUN apk add tree | ||
COPY . . | ||
|
||
RUN turbo prune --scope=app --scope=plane-deploy --docker | ||
CMD tree -I node_modules/ | ||
|
||
# Add lockfile and package.json's of isolated subworkspace | ||
FROM node:18-alpine AS installer | ||
|
||
RUN apk add --no-cache libc6-compat | ||
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/ . | ||
COPY --from=builder /app/out/yarn.lock ./yarn.lock | ||
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/ | ||
|
||
RUN chmod +x /usr/local/bin/replace-env-vars.sh | ||
|
||
RUN yarn turbo run build | ||
|
||
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_API_BASE_URL} | ||
|
||
FROM makeplane/plane-aio-base AS backend | ||
|
||
# set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 | ||
|
||
WORKDIR /code | ||
|
||
RUN apk --no-cache add \ | ||
"libpq~=15" \ | ||
"libxslt~=1.1" \ | ||
"nodejs-current~=19" \ | ||
"xmlsec~=1.2" \ | ||
"nginx" \ | ||
"nodejs" \ | ||
"npm" \ | ||
"supervisor" | ||
|
||
COPY apiserver/requirements.txt ./ | ||
COPY apiserver/requirements ./requirements | ||
RUN apk add --no-cache libffi-dev | ||
RUN apk add --no-cache --virtual .build-deps \ | ||
"bash~=5.2" \ | ||
"g++~=12.2" \ | ||
"gcc~=12.2" \ | ||
"cargo~=1.64" \ | ||
"git~=2" \ | ||
"make~=4.3" \ | ||
"postgresql13-dev~=13" \ | ||
"libc-dev" \ | ||
"linux-headers" \ | ||
&& \ | ||
pip install -r requirements.txt --compile --no-cache-dir \ | ||
&& \ | ||
apk del .build-deps | ||
|
||
# Add in Django deps and generate Django's static files | ||
COPY apiserver/manage.py manage.py | ||
COPY apiserver/plane plane/ | ||
COPY apiserver/templates templates/ | ||
|
||
RUN apk --no-cache add "bash~=5.2" | ||
COPY apiserver/bin ./bin/ | ||
|
||
RUN chmod +x ./bin/* | ||
RUN chmod -R 777 /code | ||
|
||
# Expose container port and run entry point script | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=installer /app/apps/app/next.config.js . | ||
COPY --from=installer /app/apps/app/package.json . | ||
COPY --from=installer /app/apps/space/next.config.js . | ||
COPY --from=installer /app/apps/space/package.json . | ||
|
||
COPY --from=installer /app/apps/app/.next/standalone ./ | ||
|
||
COPY --from=installer /app/apps/app/.next/static ./apps/app/.next/static | ||
|
||
COPY --from=installer /app/apps/space/.next/standalone ./ | ||
COPY --from=installer /app/apps/space/.next ./apps/space/.next | ||
|
||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
# RUN rm /etc/nginx/conf.d/default.conf | ||
####################################################################### | ||
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 | ||
|
||
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 | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["supervisord","-c","/code/supervisor.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile=/var/log/supervisord/supervisord.log | ||
pidfile=/var/run/supervisord.pid | ||
|
||
[program:postgresql] | ||
command=/usr/lib/postgresql/16/bin/postgres -D /var/lib/postgresql/16/main | ||
user=postgres | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/supervisor/postgresql.log | ||
stderr_logfile=/var/log/supervisor/postgresql_err.log | ||
|
||
[program:redis] | ||
command=/usr/bin/redis-server /etc/redis/redis.conf | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/supervisor/redis.log | ||
stderr_logfile=/var/log/supervisor/redis_err.log | ||
|
||
[program:minio] | ||
command=/usr/local/bin/minio server /data/minio --console-address ":9001" | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/supervisor/minio.log | ||
stderr_logfile=/var/log/supervisor/minio_err.log | ||
|
||
[program:nginx] | ||
command=/usr/sbin/nginx -g "daemon off;" | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/supervisor/nginx.log | ||
stderr_logfile=/var/log/supervisor/nginx_err.log |
File renamed without changes.