diff --git a/client/Dockerfile b/client/Dockerfile index e3ccefb..52d5423 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -6,7 +6,7 @@ RUN \ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ elif [ -f package-lock.json ]; then npm ci; \ elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \ - else echo "Lockfile not found." && exit 1; \ + else echo "Lockfile not found." && yarn; \ fi COPY . . RUN yarn build # or `npm run build` if using npm @@ -16,6 +16,6 @@ FROM nginx:alpine AS production # Copy built assets from 'build' stage COPY --from=build /app/build /usr/share/nginx/html # Optional: If you have a custom nginx.conf, you can copy it to the container -# COPY nginx.conf /etc/nginx/nginx.conf +COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/client/nginx.conf b/client/nginx.conf new file mode 100644 index 0000000..d8a2a69 --- /dev/null +++ b/client/nginx.conf @@ -0,0 +1,39 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + #include /etc/nginx/conf.d/*.conf; + server { + listen 80; + root /usr/share/nginx/html; + + location / { + try_files $uri /index.html; + } + } +}