-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Filipe Forattini
committed
Jul 13, 2022
1 parent
b690532
commit 59cffe9
Showing
8 changed files
with
125 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} | ||
` | ||
} | ||
} |