Version 1
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:24.16.0-alpine AS build
|
||||
|
||||
WORKDIR /app/Store
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@10.24.0 --activate
|
||||
|
||||
COPY Store/package.json Store/pnpm-lock.yaml Store/pnpm-workspace.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
ARG ALLOWED_HOSTS=""
|
||||
ARG STRIPE_PUBLISHABLE_KEY=""
|
||||
ARG STRIPE_PRICE_ID=""
|
||||
ARG API_BASE_URL=""
|
||||
|
||||
ENV ALLOWED_HOSTS=${ALLOWED_HOSTS}
|
||||
ENV STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY}
|
||||
ENV STRIPE_PRICE_ID=${STRIPE_PRICE_ID}
|
||||
ENV API_BASE_URL=${API_BASE_URL}
|
||||
|
||||
COPY Store/ ./
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
FROM nginx:1.27-alpine AS runtime
|
||||
|
||||
COPY Proxy/default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/Store/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
@@ -0,0 +1,99 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name royal-pop-accessory.com www.royal-pop-accessory.com;
|
||||
|
||||
return 308 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name api.royal-pop-accessory.com;
|
||||
|
||||
return 308 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name royal-pop-accessory.com www.royal-pop-accessory.com;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/origin.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/origin.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 1d;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript application/xml+rss application/xml image/svg+xml;
|
||||
|
||||
add_header X-Content-Type-Options nosniff always;
|
||||
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
||||
add_header X-Frame-Options SAMEORIGIN always;
|
||||
|
||||
location = /buy {
|
||||
return 308 $scheme://$host/buy/;
|
||||
}
|
||||
|
||||
location = /details {
|
||||
return 308 $scheme://$host/details/;
|
||||
}
|
||||
|
||||
location = /checkout {
|
||||
return 308 $scheme://$host/checkout/;
|
||||
}
|
||||
|
||||
location = /client {
|
||||
return 308 $scheme://$host/client/;
|
||||
}
|
||||
|
||||
location = /client/orders {
|
||||
return 308 $scheme://$host/client/orders/;
|
||||
}
|
||||
|
||||
location = /client/stock {
|
||||
return 308 $scheme://$host/client/stock/;
|
||||
}
|
||||
|
||||
location = /thank-you {
|
||||
return 308 $scheme://$host/thank-you/;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name api.royal-pop-accessory.com;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/origin.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/origin.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 1d;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript application/xml+rss application/xml image/svg+xml;
|
||||
|
||||
add_header X-Content-Type-Options nosniff always;
|
||||
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
||||
add_header X-Frame-Options SAMEORIGIN always;
|
||||
|
||||
client_max_body_size 1m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://api:8081;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
variable "REGISTRY" {
|
||||
default = "registry.mangopig.tech"
|
||||
}
|
||||
|
||||
variable "TAG" {
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
variable "ALLOWED_HOSTS" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "STRIPE_PUBLISHABLE_KEY" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "STRIPE_PRICE_ID" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "API_BASE_URL" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
target "_proxy" {
|
||||
context = "."
|
||||
dockerfile = "Proxy/Dockerfile"
|
||||
args = {
|
||||
ALLOWED_HOSTS = ALLOWED_HOSTS
|
||||
STRIPE_PUBLISHABLE_KEY = STRIPE_PUBLISHABLE_KEY
|
||||
STRIPE_PRICE_ID = STRIPE_PRICE_ID
|
||||
API_BASE_URL = API_BASE_URL
|
||||
}
|
||||
}
|
||||
|
||||
target "prod" {
|
||||
inherits = ["_proxy"]
|
||||
target = "runtime"
|
||||
tags = ["goko/royal-pop/proxy:local-prod"]
|
||||
}
|
||||
|
||||
target "prod-image" {
|
||||
inherits = ["_proxy"]
|
||||
target = "runtime"
|
||||
tags = ["${REGISTRY}/goko/royal-pop/proxy/prod:${TAG}"]
|
||||
output = ["type=registry"]
|
||||
}
|
||||
|
||||
group "local" {
|
||||
targets = ["prod"]
|
||||
}
|
||||
|
||||
group "registry" {
|
||||
targets = ["prod-image"]
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["prod"]
|
||||
}
|
||||
Reference in New Issue
Block a user