added drone and docker
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
f2f78814b8
commit
3a17c354f6
|
|
@ -0,0 +1,50 @@
|
||||||
|
kind: pipeline
|
||||||
|
name: Build Image
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# - name: Lint Check
|
||||||
|
# image: node:21-alpine
|
||||||
|
# commands:
|
||||||
|
# - yarn install
|
||||||
|
# # - yarn lint
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
build_args: "API_BASE_URL=https://http://www.sangwaritaxi.com"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: git.midastix.com/ci-docker-repo-user/sangwaritaxi_website
|
||||||
|
registry: git.midastix.com
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: Deploy image
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host: sangwaritaxi.com
|
||||||
|
username: sangwaritaxi_website
|
||||||
|
key:
|
||||||
|
from_secret: server_ssh_pkey
|
||||||
|
port: 22
|
||||||
|
command_timeout: 3m
|
||||||
|
script:
|
||||||
|
- echo "Deploying image"
|
||||||
|
- sudo /opt/deployable/sangwaritaxi_website/docker/deploy.sh
|
||||||
|
- echo "Completed Deployment"
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
# trigger:
|
||||||
|
# branch:
|
||||||
|
# - main
|
||||||
|
# - feature/env_api_url
|
||||||
|
# event:
|
||||||
|
# - push
|
||||||
31
dockerfile
31
dockerfile
|
|
@ -1,17 +1,26 @@
|
||||||
# Use the official Nginx image from Docker Hub
|
FROM node:21-alpine as builder
|
||||||
FROM nginx:alpine
|
|
||||||
|
|
||||||
# Set working directory
|
ARG API_BASE_URL="https://mfs-api.midastix.com"
|
||||||
WORKDIR /usr/share/nginx/html
|
|
||||||
|
|
||||||
# Remove the default Nginx static assets
|
ENV REACT_APP_API_BASE_URL $API_BASE_URL
|
||||||
RUN rm -rf ./*
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package.json
|
||||||
|
COPY yarn.lock yarn.lock
|
||||||
|
|
||||||
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
# Copy your HTML, CSS, JS, etc., to the container
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Expose port 80
|
RUN yarn build
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /app/build ./build
|
||||||
|
|
||||||
|
CMD ["sh"]
|
||||||
|
|
||||||
# Start Nginx server
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue