Update 2 files

- /Dockerfile
- /.gitlab-ci.yml
This commit is contained in:
Lee 2023-01-13 23:21:53 +00:00
parent f7df051446
commit e2203be1a9
2 changed files with 22 additions and 16 deletions

View File

@ -1,19 +1,20 @@
docker-build:
# Official docker image.
image: docker:latest
stage: build
variables:
DOCKER_DRIVER: overlay
# docker-build:
# # Official docker image.
# image: docker:latest
# stage: build
# variables:
# DOCKER_DRIVER: overlay
# services:
# - docker:dind
# before_script:
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# script:
# - docker build --pull -t "$CI_REGISTRY_IMAGE" .
# - docker push "$CI_REGISTRY_IMAGE"
# only:
# - main
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- main
deploy:
image: alpine:latest
@ -24,3 +25,8 @@ deploy:
- chmod og= $ID_RSA
- apk update && apk add openssh-client
- ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "cd /home/overlay && docker compose pull && docker compose up -d"
environment:
name: production
url: https://bs-overlay.fascinated.cc
only:
- master

View File

@ -53,7 +53,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static
RUN npm i @beam-australia/react-env
RUN npm i -g @beam-australia/react-env
RUN chown -R nextjs:nodejs /app