mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
Fix deploy (#183)
This commit is contained in:
3 files changed
+23
-13
No files matched your search
@@ -1,5 +1,6 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
error_log /var/log/nginx/error.log debug;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
@@ -10,15 +11,29 @@ server {
|
|||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://backend:3000;
|
proxy_pass http://backend:3000;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_connect_timeout 60s;
|
||||||
|
proxy_send_timeout 60s;
|
||||||
|
proxy_read_timeout 60s;
|
||||||
|
proxy_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /trpc/ {
|
location /trpc/ {
|
||||||
proxy_pass http://backend:3000;
|
proxy_pass http://backend:3000;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_connect_timeout 60s;
|
||||||
|
proxy_send_timeout 60s;
|
||||||
|
proxy_read_timeout 60s;
|
||||||
|
proxy_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api-docs/ {
|
location /api-docs/ {
|
||||||
proxy_pass http://backend:3000;
|
proxy_pass http://backend:3000;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /socket.io/ {
|
location /socket.io/ {
|
||||||
@@ -28,5 +43,9 @@ server {
|
|||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
proxy_connect_timeout 60s;
|
||||||
|
proxy_send_timeout 60s;
|
||||||
|
proxy_read_timeout 60s;
|
||||||
|
proxy_buffering off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -5,7 +5,6 @@ COPY ./package.json yarn.lock ./
|
|||||||
COPY server/package.json ./server/package.json
|
COPY server/package.json ./server/package.json
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
# Install docker cli
|
# Install docker cli
|
||||||
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
|
|
||||||
COPY server ./server
|
COPY server ./server
|
||||||
COPY packages ./packages
|
COPY packages ./packages
|
||||||
COPY tsconfig.json ./tsconfig.json
|
COPY tsconfig.json ./tsconfig.json
|
||||||
@@ -15,6 +14,7 @@ RUN yarn workspace server build
|
|||||||
FROM node:20-alpine as prod
|
FROM node:20-alpine as prod
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
|
||||||
COPY --from=build /app/node_modules ./node_modules
|
COPY --from=build /app/node_modules ./node_modules
|
||||||
COPY --from=build /app/server ./server
|
COPY --from=build /app/server ./server
|
||||||
COPY ./quests ./quests
|
COPY ./quests ./quests
|
||||||
|
|||||||
@@ -23,19 +23,10 @@ const logger = winston.createLogger({
|
|||||||
dirname: config.log.path,
|
dirname: config.log.path,
|
||||||
filename: 'combined.log',
|
filename: 'combined.log',
|
||||||
}),
|
}),
|
||||||
|
new winston.transports.Console({
|
||||||
|
format: winston.format.simple(),
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
//
|
|
||||||
// If we're not in production then log to the `console` with the format:
|
|
||||||
// `${info.level}: ${info.message} JSON.stringify({ ...rest }) `
|
|
||||||
//
|
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
|
||||||
logger.add(
|
|
||||||
new winston.transports.Console({
|
|
||||||
format: winston.format.simple(),
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default logger
|
export default logger
|
||||||
Reference in new issue
Block a user