Skip to content

Commit

Permalink
add fly and fix docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilenka committed Apr 27, 2021
1 parent f7eb66a commit b917665
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
node_modules/
dist
dist/
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM node:13-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
FROM mhart/alpine-node

WORKDIR /app

COPY . .
RUN npm install
RUN npm run build

RUN yarn install
RUN yarn build

EXPOSE 3000
RUN npm start

CMD ["yarn", "start"]
36 changes: 36 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# fly.toml file generated for twilight-frost-2680 on 2021-04-27T18:49:57+07:00

app = "twilight-frost-2680"

kill_signal = "SIGINT"
kill_timeout = 5

[env]

[experimental]
auto_rollback = true

[[services]]
http_checks = []
internal_port = 3000
protocol = "tcp"
script_checks = []

[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"

[[services.ports]]
handlers = ["http"]
port = 80

[[services.ports]]
handlers = ["tls", "http"]
port = 443

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 6
timeout = "2s"
2 changes: 0 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ app.use('/kel', require('./resources/village/village.router'))
app.use('/desa', require('./resources/village/village.router'))
app.use('/village', require('./resources/village/village.router'))

console.log({ URL: process.env })

export const start = async () => {
try {
await connect()
Expand Down

0 comments on commit b917665

Please sign in to comment.