diff options
| -rw-r--r-- | Dockerfile | 13 | ||||
| -rw-r--r-- | docker-stack.yml | 7 | ||||
| -rw-r--r-- | nginx.conf | 11 |
3 files changed, 17 insertions, 14 deletions
@@ -13,18 +13,7 @@ RUN bun run build FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html -COPY <<'EOF' /etc/nginx/conf.d/default.conf -server { - listen 80; - server_name _; - root /usr/share/nginx/html; - index index.html; - - location / { - try_files $uri $uri/ /index.html; - } -} -EOF +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file diff --git a/docker-stack.yml b/docker-stack.yml index 9b10293..730e730 100644 --- a/docker-stack.yml +++ b/docker-stack.yml @@ -4,9 +4,12 @@ services: web: image: ${IMAGE_NAME} ports: - - "8280:80" + - target: 80 + published: 8280 + protocol: tcp + mode: host deploy: - replicas: 2 + replicas: 1 update_config: parallelism: 1 delay: 10s diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..483d49c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,11 @@ +server { + listen 80; + listen [::]:80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +} |
