Skip to content

Commit

Permalink
fix: empty commit for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed Jul 13, 2022
1 parent b690532 commit 59cffe9
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/actions/create-dockerfile/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/create-dockerfile/index.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ jobs:
if: needs.Setup.outputs.Event == 'push'

needs:
- Setup
- Static-Analysis

outputs:
Expand Down Expand Up @@ -173,7 +172,6 @@ jobs:
if: github.event_name == 'push'

needs:
- Setup
- Release

steps:
Expand Down
7 changes: 2 additions & 5 deletions src/actions/create-dockerfile/stubs/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const fs = require('fs')
const path = require('path')

module.exports = {
python: fs.readFileSync(path.join(__dirname, 'python')).toString(),
javascript: fs.readFileSync(path.join(__dirname, 'javascript')).toString(),
python: require('./python'),
javascript: require('./javascript'),
}
14 changes: 0 additions & 14 deletions src/actions/create-dockerfile/stubs/javascript.dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
stub: `
# This file was autogenerated at <%= generatedAt %>.
FROM <%= image %>:<%= tag %>
Expand All @@ -12,3 +14,17 @@ RUN <%= dependencyCommand %>
ENTRYPOINT ["python"]
CMD ["app.py"]
`,

defaults: {
image: 'alpine',
tag: '17',
labels: [],
environmentVariables: [],
dependencyCommand: [],
entrypoint: 'npm',
command: 'start',
},

files: []
}
30 changes: 30 additions & 0 deletions src/actions/create-dockerfile/stubs/python.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
stub: `
# This file was autogenerated at <%= generatedAt %>.
FROM <%= image %>:<%= tag %>
LABEL <%= labels %>
ENV <%= environmentVariables %>
WORKDIR /app
COPY . /app
RUN <%= dependencyCommand %>
ENTRYPOINT ["python"]
CMD ["app.py"]
`,

defaults: {
image: 'python',
tag: '3.7',
labels: [],
environmentVariables: [],
dependencyCommand: [],
entrypoint: 'python',
command: 'app.py',
},

files: []
}
75 changes: 75 additions & 0 deletions src/actions/create-dockerfile/stubs/spa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module.exports = {
stub: `
# This file was autogenerated at <%= generatedAt %>.
FROM node:17-alpine as builder
WORKDIR /app
COPY . .
RUN npm i \
&& npm run build
FROM nginx:alpine
COPY ./nginx.conf /etc/nginx/nginx.conf
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/build /usr/share/nginx/html
EXPOSE 80
ENTRYPOINT ["nginx"]
CMD ["-g daemon off;"]
`,

defaults: {},

files: {
'nginx.conf': `
worker_processes auto;
events {
worker_connections 8000;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
server {
listen 80;
access_log /var/log/nginx/access.log compression;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ~ ^.+\..+$ {
try_files $uri =404;
}
}
}
`
}
}

0 comments on commit 59cffe9

Please sign in to comment.