Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 286dec2

Browse files
committed
setup prod path
1 parent 58f24fd commit 286dec2

5 files changed

Lines changed: 107 additions & 0 deletions

File tree

.github/workflows/prod.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Wheels.dev
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy-to-docker-swarm:
10+
runs-on: [self-hosted, Linux, pai]
11+
12+
steps:
13+
- name: Checkout Repository
14+
id: Checkout-Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Create Environment Files
18+
id: Create-Environment-Files
19+
run: |
20+
cp ./deploy/prod/.env ./
21+
cp ./deploy/prod/server.json ./
22+
cp ./deploy/prod/docker-compose.yml ./
23+
cp ./deploy/prod/dockerfile ./
24+
25+
- name: Install Dependencies
26+
id: Install-Dependencies
27+
run: |
28+
box install
29+
30+
- name: Login to Docker Registry
31+
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login "${{ secrets.DOCKER_HUB_IP }}":"${{ secrets.DOCKER_HUB_PORT}}" -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
32+
33+
- name: Push Docker Image
34+
id: Push-Docker-Image
35+
run: |
36+
docker build -t ${{ secrets.DOCKER_HUB_IP }}:${{ secrets.DOCKER_HUB_PORT}}/wheels-dev-prod .
37+
docker push ${{ secrets.DOCKER_HUB_IP }}:${{ secrets.DOCKER_HUB_PORT}}/wheels-dev-prod
38+
39+
- name: Deploy to Docker Swarm
40+
id: Deploy-to-Docker-Swarm
41+
run: |
42+
docker pull ${{ secrets.DOCKER_HUB_IP }}:${{ secrets.DOCKER_HUB_PORT}}/wheels-dev-prod
43+
docker stack deploy --with-registry-auth -c docker-compose.yml prod
44+
45+
- name: Post Slack Message
46+
id: Post-Slack-Message
47+
uses: act10ns/slack@v2
48+
with:
49+
status: ${{ job.status }}
50+
steps: ${{ toJson(steps) }}
51+
channel: '#it_builds'
52+
if: always()
File renamed without changes.

deploy/prod/docker-compose.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: '3.8'
2+
3+
services:
4+
wheels-dev:
5+
image: 10.100.10.116:5000/wheels-dev-prod
6+
deploy:
7+
replicas: 3
8+
restart_policy:
9+
condition: on-failure
10+
update_config:
11+
parallelism: 1
12+
delay: 15s
13+
placement:
14+
constraints: []
15+
ports:
16+
- "50150:60150"
17+
environment:
18+
- PORT=60151
19+
- HEALTHCHECK_URI=http://127.0.0.1:60150/
20+
networks:
21+
- wheels-net
22+
volumes:
23+
- shared-images:/app/public/images
24+
- shared-files:/app/public/files
25+
- wheels-data:/data
26+
27+
networks:
28+
wheels-net:
29+
driver: overlay
30+
31+
volumes:
32+
shared-images:
33+
external: true
34+
shared-files:
35+
external: true
36+
wheels-data:

deploy/prod/dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ortussolutions/commandbox:latest
2+
3+
# Set working directory
4+
WORKDIR /app
5+
6+
#Copy files to working directory
7+
COPY . .
8+
9+
# Expose the port
10+
EXPOSE 60150
11+
ENV PORT 60150
12+
ENV HEALTHCHECK_URI "http://127.0.0.1:60150/"
13+
#ENV ENV_MODE "remote"
14+
15+
#Keep the server from trying to open in a browser
16+
RUN box config set server.defaults.openBrowser=false
17+
18+
#Start the server
19+
CMD ["box", "server", "start", "--console"]

0 commit comments

Comments
 (0)