-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #749 from OSMCha/jlow/deployment-cleanup
Clean up deployment workflow
- Loading branch information
Showing
9 changed files
with
61 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
FROM node:16-slim as builder | ||
FROM node:22-alpine as builder | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ARG BUILD_ENV=prod | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
COPY package.json /app | ||
COPY yarn.lock /app | ||
COPY package.json yarn.lock /app/ | ||
RUN yarn set version stable | ||
RUN yarn install | ||
|
||
COPY . /app/ | ||
COPY src/ /app/src | ||
COPY public/ /app/public | ||
ENV REACT_APP_PRODUCTION_API_URL /api/v1 | ||
RUN yarn build:${BUILD_ENV} | ||
|
||
# fix for openssl ERR_OSSL_EVP_UNSUPPORTED | ||
# 'error:03000086:digital envelope routines::initialization error' | ||
ENV NODE_OPTIONS --openssl-legacy-provider | ||
|
||
RUN yarn run build:${BUILD_ENV} | ||
|
||
FROM nginx:alpine | ||
COPY --from=builder /app/build /assets | ||
COPY --from=builder /app/build /srv/www | ||
COPY nginx.conf /etc/nginx/templates/default.conf.template |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
server { | ||
listen 80; | ||
charset utf-8; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
gzip on; | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
|
||
location ~ ^/(api|admin) { | ||
# /api and /admin routes are handled by the backend | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_pass $BACKEND_URL; | ||
} | ||
|
||
location /static { | ||
# /static files are served without any magic (exact path or 404) | ||
root /srv/www; | ||
try_files $uri =404; | ||
} | ||
|
||
location / { | ||
# other routes are served by trying the exact path, and falling back to | ||
# serving the app entrypoint (index.html). this is needed because the | ||
# frontend JS code uses the path component of the URL in its client-side | ||
# routing. | ||
root /srv/www; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import { createBrowserHistory } from 'history'; | ||
import { isDev } from '../config'; | ||
let historyConfig = {}; | ||
if (isDev) { | ||
historyConfig.basename = '/osmcha-frontend'; | ||
} | ||
|
||
const history = createBrowserHistory(historyConfig); | ||
export { history }; |
Oops, something went wrong.