Skip to content

Commit

Permalink
Caddy updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
fergmac committed Oct 10, 2024
1 parent 8f56155 commit 2dabd5f
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
oc_version: "4.14.37"
oc_version: "4.14.30"
file: frontend/openshift.deploy.yml
parameters:
-p TAG=-dev-${{ github.event.number }}
Expand Down
27 changes: 16 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ services:
### Frontend ###
#############################################################################################
frontend:
working_dir: /app
image: node:14.21.3
hostname: frontend
# working_dir: /app/frontend
# build:
# context: ./frontend
# dockerfile: Dockerfile
hostname: frontend
environment:
DEBUG: "true"
VUE_APP_AXIOS_BASE_URL: "http://localhost:8000/gwells/api/v2/"
Expand All @@ -117,8 +118,10 @@ services:
API_TARGET: "http://localhost:8000/"
BACKEND_URL: "http://localhost:8000"
LOG_LEVEL: "info"
command: npm i && npm run server
image: node:14.21.3
command: /bin/bash -c "
cd /frontend &&
npm install &&
npm run serve"
ports:
- "3000:3000"
volumes:
Expand All @@ -134,16 +137,16 @@ services:
build: ./frontend
environment:
NODE_ENV: development
PORT: 3000
BACKEND_URL: http://backend:3000
PORT: 3005
BACKEND_URL: http://backend:8000
LOG_LEVEL: info
ports: ["3005:3000"]
ports: ["3005:3006"]
volumes: ["./frontend/Caddyfile:/etc/caddy/Caddyfile"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
depends_on:
backend:
condition: service_healthy
test: ["CMD", "curl", "-f", "http://localhost:3005"]
# depends_on:
# backend:
# condition: service_healthy

#############################################################################################
### Backend ###
Expand Down Expand Up @@ -208,6 +211,8 @@ services:
LOAD_FIXTURES: "true"
volumes:
- ./backend:/backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000"]
ports:
- "8000:8000"
depends_on:
Expand Down
8 changes: 1 addition & 7 deletions frontend/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
:3001 {
handle /health {
respond "OK"
}
}

{
auto_https off
admin 0.0.0.0:3003
servers {
metrics
}
}
:3000 {
:3005 {
log {
output stdout
format console {
Expand Down
4 changes: 2 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ FROM caddy:2.8.4-alpine
RUN apk add --no-cache ca-certificates

# Copy static files, verify Caddyfile formatting
COPY --from=build /app/dist /srv
COPY --from=build /app/dist /srv/gwells
COPY Caddyfile /etc/caddy/Caddyfile
RUN caddy fmt /etc/caddy/Caddyfile

# Boilerplate, not used in OpenShift/Kubernetes
EXPOSE 3000 3001
EXPOSE 3005 3001
HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost:3001/health

# Nonroot user
Expand Down
Loading

0 comments on commit 2dabd5f

Please sign in to comment.