-
Notifications
You must be signed in to change notification settings - Fork 85
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
Showing
7 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
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,5 @@ | ||
up: | ||
docker-compose -f docker-compose.yml up --build | ||
|
||
down: | ||
docker-compose -f docker-compose.yml down |
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,17 @@ | ||
FROM golang:1.16.5-alpine3.13 | ||
|
||
WORKDIR /development | ||
COPY development/backend/air.toml . | ||
|
||
WORKDIR /go/src/isucondition | ||
|
||
ENV DOCKERIZE_VERSION v0.6.1 | ||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& go get -u github.com/cosmtrek/air | ||
|
||
COPY webapp/go/go.mod . | ||
# COPY webapp/go/go.sum . | ||
|
||
RUN go mod download |
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,53 @@ | ||
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format | ||
|
||
# Working directory | ||
# . or absolute path, please note that the directories following must be under root. | ||
root = "/go/src/isucondition" | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
# Just plain old shell command. You could use `make` as well. | ||
cmd = "go build -o isucondition ." | ||
# Binary file yields from `cmd`. | ||
bin = "isucondition" | ||
# Customize binary. | ||
full_bin = "APP_ENV=dev APP_USER=air ./isucondition" | ||
# Watch these filename extensions. | ||
include_ext = ["go"] | ||
# Ignore these filename extensions or directories. | ||
exclude_dir = [] | ||
# Watch these directories if you specified. | ||
include_dir = [] | ||
# Exclude files. | ||
exclude_file = [] | ||
# Exclude specific regular expressions. | ||
exclude_regex = [] | ||
# Exclude unchanged files. | ||
exclude_unchanged = true | ||
# Follow symlink for directories | ||
follow_symlink = true | ||
# This log file places in your tmp_dir. | ||
log = "air.log" | ||
# It's not necessary to trigger build each time file changes if it's too frequent. | ||
delay = 1000 # ms | ||
# Stop running old binary when build errors occur. | ||
stop_on_error = true | ||
# Send Interrupt signal before killing process (windows does not support this feature) | ||
send_interrupt = false | ||
# Delay after sending Interrupt signal | ||
kill_delay = 500 # ms | ||
|
||
[log] | ||
# Show log time | ||
time = false | ||
|
||
[color] | ||
# Customize each part's color. If no color found, use the raw app log. | ||
main = "magenta" | ||
watcher = "cyan" | ||
build = "yellow" | ||
runner = "green" | ||
|
||
[misc] | ||
# Delete tmp directory on exit | ||
clean_on_exit = true |
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,35 @@ | ||
version: "3.8" | ||
|
||
services: | ||
backend: | ||
build: | ||
context: .. | ||
dockerfile: development/backend/Dockerfile | ||
environment: | ||
MYSQL_HOST: mysql-backend | ||
MYSQL_PORT: 3306 | ||
MYSQL_DATABASE: isucondition | ||
MYSQL_USER: isucon | ||
MYSQL_PASSWORD: isucon | ||
entrypoint: dockerize -wait tcp://mysql-backend:3306 -timeout 60s | ||
command: air -c /development/air.toml | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- "../webapp/go:/go/src/isucondition" | ||
depends_on: | ||
- mysql-backend | ||
|
||
mysql-backend: | ||
image: mysql:8.0.25 | ||
restart: always | ||
environment: | ||
MYSQL_DATABASE: isucondition | ||
MYSQL_USER: isucon | ||
MYSQL_PASSWORD: isucon | ||
MYSQL_ROOT_PASSWORD: root | ||
expose: | ||
- "3306" | ||
ports: | ||
- "3306:3306" | ||
|
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 @@ | ||
isucondition |
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,3 @@ | ||
module github.com/isucon/isucon11-qualify/isucondition | ||
|
||
go 1.16 |
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,13 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
func main() { | ||
for { | ||
fmt.Println("Hello World") | ||
time.Sleep(time.Second * 10) | ||
} | ||
} |