Skip to content

Commit

Permalink
fix node modules in staging and prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolpheus89 committed Jan 10, 2025
1 parent a9e062d commit 870ce2a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/prod-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

# login with Docker

- uses: docker/login-action@v1
- uses: docker/login-action@v3
name: Login to Docker Hub

with:
Expand All @@ -36,13 +36,13 @@ jobs:

# prepare buildx for docker

- uses: docker/setup-buildx-action@v1
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx


# build and push the newly created image

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
name: Build and push

with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prod-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4


# login with Docker

- uses: docker/login-action@v1
- uses: docker/login-action@v3
name: Login to Docker Hub

with:
Expand All @@ -37,13 +37,13 @@ jobs:

# prepare buildx for docker

- uses: docker/setup-buildx-action@v1
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx


# build and push the newly created image

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
name: Build and push

with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/staging-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

# login with Docker

- uses: docker/login-action@v1
- uses: docker/login-action@v3
name: Login to Docker Hub

with:
Expand All @@ -36,13 +36,13 @@ jobs:

# prepare buildx for docker

- uses: docker/setup-buildx-action@v1
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx


# build and push the newly created image

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
name: Build and push

with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/staging-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4


# login with Docker

- uses: docker/login-action@v1
- uses: docker/login-action@v3
name: Login to Docker Hub

with:
Expand All @@ -37,13 +37,13 @@ jobs:

# prepare buildx for docker

- uses: docker/setup-buildx-action@v1
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx


# build and push the newly created image

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
name: Build and push

with:
Expand Down
6 changes: 2 additions & 4 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bookworm
FROM node:18-alpine

WORKDIR /client

Expand All @@ -9,6 +9,4 @@ RUN npm ci

COPY . .
# Build is needed for build in github action
RUN npm run build

CMD npm run preview
RUN npm run build
6 changes: 2 additions & 4 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
services:
client:
image: dolpheus89/prod_client_pawplanner
command: sh -c "npm run build && npm run preview"
command: sh -c "npm run preview"
restart: unless-stopped
ports:
- 4201:4200
volumes:
- web-client-build:/client/dist
- node_modules:/client/node_modules
# Fixit for HR in Windows
environment:
- WDS_SOCKET=127.0.0.1
- CHOKIDAR_USEPOLLING=true
Expand All @@ -31,6 +29,7 @@ services:
- SMTP_PASS=${SMTP_PASS}
- NODE_ENV="production"
- FRONTEND_URL=${FRONTEND_URL}
- JWTSECRETKEY=${JWTSECRETKEY}

db:
image: postgres:16
Expand Down Expand Up @@ -68,5 +67,4 @@ services:

volumes:
web-client-build:
node_modules:
db_data:
6 changes: 2 additions & 4 deletions docker-compose.staging.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
services:
client:
image: dolpheus89/staging_client_pawplanner
command: sh -c "npm run build && npm run preview"
command: sh -c "npm run preview"
restart: unless-stopped
ports:
- 4200:4200
volumes:
- web-client-build:/client/dist
- node_modules:/client/node_modules
# Fixit for HR in Windows
environment:
- WDS_SOCKET=127.0.0.1
- CHOKIDAR_USEPOLLING=true
Expand All @@ -31,6 +29,7 @@ services:
- SMTP_PASS=${SMTP_PASS}
- NODE_ENV="production"
- FRONTEND_URL=${FRONTEND_URL}
- JWTSECRETKEY=${JWTSECRETKEY}

db:
image: postgres:16
Expand Down Expand Up @@ -68,5 +67,4 @@ services:

volumes:
web-client-build:
node_modules:
db_data:
2 changes: 1 addition & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bookworm
FROM node:18-alpine

WORKDIR /server

Expand Down

0 comments on commit 870ce2a

Please sign in to comment.