Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Revert Dockerfile optimization #2817

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 40 additions & 15 deletions .github/workflows/deploy-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,50 @@ on:
jobs:
dockerhub-push:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || (github.event_name == 'release' && github.event.action == 'released')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v3
- name: Dockerhub login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Deploy Dockerhub main
- name: Deploy Main
if: github.ref == 'refs/heads/main'
run: bash scripts/github/deploy_docker.sh staging
env:
DOCKERHUB_PROJECT: ${{ secrets.DOCKER_PROJECT }}
- name: Deploy Dockerhub dev
uses: docker/build-push-action@v5
with:
push: true
tags: safeglobal/safe-wallet-web:staging
platforms: |
linux/amd64
linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy Develop
if: github.ref == 'refs/heads/dev'
run: bash scripts/github/deploy_docker.sh dev
env:
DOCKERHUB_PROJECT: ${{ secrets.DOCKER_PROJECT }}
- name: Deploy Dockerhub tag
if: startsWith(github.ref, 'refs/tags/')
run: bash scripts/github/deploy_docker.sh ${GITHUB_REF##*/}
env:
DOCKERHUB_PROJECT: ${{ secrets.DOCKER_PROJECT }}
uses: docker/build-push-action@v5
with:
push: true
tags: safeglobal/safe-wallet-web:dev
platforms: |
linux/amd64
linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy Tag
if: (github.event_name == 'release' && github.event.action == 'released')
uses: docker/build-push-action@v5
with:
push: true
tags: |
safeglobal/safe-wallet-web:${{ github.event.release.tag_name }}
safeglobal/safe-wallet-web:latest
platforms: |
linux/amd64
linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
35 changes: 11 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
FROM node:18-alpine AS base
ENV NEXT_TELEMETRY_DISABLED 1

FROM base AS builder

FROM node:18-alpine
RUN apk add --no-cache libc6-compat git python3 py3-pip make g++ libusb-dev eudev-dev linux-headers
WORKDIR /app

# Install dependencies
COPY package.json yarn.lock* ./
RUN yarn --frozen-lockfile
COPY . .
RUN yarn run after-install

RUN yarn build

# Production image
FROM base AS runner
WORKDIR /app
# install deps
RUN yarn install --frozen-lockfile
RUN yarn after-install

ENV NODE_ENV production
ENV REVERSE_PROXY_UI_PORT 8080

RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder /app/out ./out

# Set the correct permission for prerender cache
RUN mkdir .next && chown nextjs:nodejs .next
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1

USER nextjs
EXPOSE 3000

EXPOSE ${REVERSE_PROXY_UI_PORT}
ENV PORT 3000

CMD npx -y serve out -p ${REVERSE_PROXY_UI_PORT}
CMD ["yarn", "static-serve"]
24 changes: 0 additions & 24 deletions scripts/github/deploy_docker.sh

This file was deleted.

Loading