Skip to content

update Dockerfiles, nginx, index.json ... #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions angularjs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ FROM public.ecr.aws/nginx/nginx
COPY --from=build-stage /app/dist/angularjs/ /usr/share/nginx/html
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
2 changes: 0 additions & 2 deletions aws-fargate/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ COPY . .

RUN npm install

EXPOSE 3000

CMD ["node", "index.js"]
40 changes: 39 additions & 1 deletion aws-fargate/.microtica/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
},
"ContainerPort": {
"Type": "String"
},
"AppType": {
"Type": "String",
"Description": "Type of application that will be deployed: nodejs, reactjs, ..."
}
},
"Conditions": {
Expand Down Expand Up @@ -91,6 +95,14 @@
"Condition": "EnableHTTP"
}
]
},
"Isn8n": {
"Fn::Equals": [
{
"Ref": "AppType"
},
"n8n"
]
}
},
"Resources": {
Expand Down Expand Up @@ -200,7 +212,13 @@
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties": {
"HealthCheckIntervalSeconds": 10,
"HealthCheckPath": "/",
"HealthCheckPath": {
"Fn::If": [
"Isn8n",
"/healthz",
"/"
]
},
"HealthCheckProtocol": "HTTP",
"HealthCheckTimeoutSeconds": 5,
"HealthyThresholdCount": 2,
Expand Down Expand Up @@ -447,6 +465,26 @@
"Value": {
"Ref": "AWS::Region"
}
},
{
"Name": "PORT",
"Value": {
"Ref": "ContainerPort"
}
},
{
"Fn::If": [
"Isn8n",
{
"Name": "N8N_PORT",
"Value": {
"Ref": "ContainerPort"
}
},
{
"Ref": "AWS::NoValue"
}
]
}
],
"LogConfiguration": {
Expand Down
7 changes: 6 additions & 1 deletion aws-fargate/.microtica/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
"CertificateArn": {
"type": "string",
"description": "A custom domain certificate (AWS Certificate Manager)."
},
"AppType": {
"type": "string",
"description": "Type of application that will be deployed: nodejs, reactjs, ..."
}
},
"required": [
Expand All @@ -87,7 +91,8 @@
"Memory",
"DesiredReplicas",
"ImageUrl",
"ContainerPort"
"ContainerPort",
"AppType"
]
}
},
Expand Down
3 changes: 1 addition & 2 deletions django4/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .

EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
CMD python manage.py runserver 0.0.0.0:${PORT}
2 changes: 0 additions & 2 deletions gatsby/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ ENV NODE_ENV production

RUN npm run build

EXPOSE 9000

CMD npm run serve
2 changes: 1 addition & 1 deletion gatsby/.microtica/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ map $sent_http_content_type $expires {
}

server {
listen 80;
listen ${PORT};
location / {
root /usr/share/nginx/html;
index index.html index.htm;
Expand Down
2 changes: 0 additions & 2 deletions gin/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ COPY . .

RUN go build

EXPOSE 8080

CMD ["go", "run", "main.go"]
2 changes: 0 additions & 2 deletions iris/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ COPY . .

RUN go build

EXPOSE 8080

CMD ["go", "run", "main.go"]
2 changes: 0 additions & 2 deletions medusa-server/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ RUN npm install @medusajs/medusa-cli -g

ENV NODE_ENV production

EXPOSE 9000

CMD npx medusa db:migrate && cd .medusa/server && npm run start
2 changes: 0 additions & 2 deletions nestjs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ COPY . .
RUN yarn install
RUN yarn build

EXPOSE 3000

CMD ["yarn", "start"]
3 changes: 2 additions & 1 deletion nestjs/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AppModule } from './app.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
const port = process.env.PORT;
await app.listen(port || 3000);
}
bootstrap();
2 changes: 0 additions & 2 deletions nextjs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ ENV NODE_ENV production

RUN yarn build

EXPOSE 3000

CMD ["yarn", "start"]
2 changes: 0 additions & 2 deletions nodejs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ COPY . .

RUN npm install

EXPOSE 3000

CMD ["node", "index.js"]
4 changes: 1 addition & 3 deletions nuxtjs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ ENV NODE_ENV production

RUN yarn build

EXPOSE 3000

ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
ENV NUXT_PORT=${PORT}

CMD ["yarn", "start"]
11 changes: 7 additions & 4 deletions reactjs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stage 1; build and compile the frontend
# Stage 1: Build and compile the frontend
FROM public.ecr.aws/docker/library/node:16.16.0-slim as build-stage

WORKDIR /app
Expand All @@ -11,12 +11,15 @@ COPY . .

RUN yarn build

# Stage 2; nginx
# Stage 2: Nginx
FROM public.ecr.aws/nginx/nginx

RUN apt-get update && apt-get install -y gettext-base

COPY --from=build-stage /app/build/ /usr/share/nginx/html
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.template

CMD ["nginx", "-g", "daemon off;"]
CMD envsubst '$PORT' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && \
nginx -g 'daemon off;'
2 changes: 1 addition & 1 deletion reactjs/.microtica/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ map $sent_http_content_type $expires {
}

server {
listen 80;
listen ${PORT};
location / {
root /usr/share/nginx/html;
index index.html index.htm;
Expand Down
2 changes: 0 additions & 2 deletions strapi-serverless/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ ENV NODE_ENV production

RUN yarn build

EXPOSE 1337

CMD ["yarn", "start"]
2 changes: 0 additions & 2 deletions strapi/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ ENV NODE_ENV production

RUN yarn build

EXPOSE 1337

CMD ["yarn", "start"]
7 changes: 5 additions & 2 deletions svelte/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ RUN yarn build
# Stage 2; nginx
FROM public.ecr.aws/nginx/nginx

RUN apt-get update && apt-get install -y gettext-base

COPY --from=build-stage /app/dist/ /usr/share/nginx/html
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.template

CMD ["nginx", "-g", "daemon off;"]
CMD envsubst '$PORT' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && \
nginx -g 'daemon off;'
2 changes: 1 addition & 1 deletion svelte/.microtica/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ map $sent_http_content_type $expires {
}

server {
listen 80;
listen ${PORT};
location / {
root /usr/share/nginx/html;
index index.html index.htm;
Expand Down
7 changes: 5 additions & 2 deletions vuejs/.microtica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ RUN yarn build
# Stage 2; nginx
FROM public.ecr.aws/nginx/nginx

RUN apt-get update && apt-get install -y gettext-base

COPY --from=build-stage /app/dist/ /usr/share/nginx/html
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
COPY ./.microtica/nginx.conf /etc/nginx/conf.d/default.template

CMD ["nginx", "-g", "daemon off;"]
CMD envsubst '$PORT' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && \
nginx -g 'daemon off;'
2 changes: 1 addition & 1 deletion vuejs/.microtica/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ map $sent_http_content_type $expires {
}

server {
listen 80;
listen ${PORT};
location / {
root /usr/share/nginx/html;
index index.html index.htm;
Expand Down