Skip to content

Commit 27f097d

Browse files
committed
add docker
1 parent d27c8f7 commit 27f097d

File tree

6 files changed

+151
-2
lines changed

6 files changed

+151
-2
lines changed

Diff for: .dockerignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
### Go template
2+
# If you prefer the allow list template instead of the deny list, see community template:
3+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
4+
#
5+
# Binaries for programs and plugins
6+
*.exe
7+
*.exe~
8+
*.dll
9+
*.so
10+
*.dylib
11+
12+
# Test binary, built with `go test -c`
13+
*.test
14+
15+
# Output of the go coverage tool, specifically when used with LiteIDE
16+
*.out
17+
18+
# Dependency directories (remove the comment below to include it)
19+
# vendor/
20+
21+
# Go workspace file
22+
go.work
23+
24+
### GoLand template
25+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
26+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
27+
28+
# User-specific stuff
29+
.idea/**/workspace.xml
30+
.idea/**/tasks.xml
31+
.idea/**/usage.statistics.xml
32+
.idea/**/dictionaries
33+
.idea/**/shelf
34+
35+
# AWS User-specific
36+
.idea/**/aws.xml
37+
38+
# Generated files
39+
.idea/**/contentModel.xml
40+
41+
# Sensitive or high-churn files
42+
.idea/**/dataSources/
43+
.idea/**/dataSources.ids
44+
.idea/**/dataSources.local.xml
45+
.idea/**/sqlDataSources.xml
46+
.idea/**/dynamic.xml
47+
.idea/**/uiDesigner.xml
48+
.idea/**/dbnavigator.xml
49+
50+
# Gradle
51+
.idea/**/gradle.xml
52+
.idea/**/libraries
53+
54+
# Gradle and Maven with auto-import
55+
# When using Gradle or Maven with auto-import, you should exclude module files,
56+
# since they will be recreated, and may cause churn. Uncomment if using
57+
# auto-import.
58+
# .idea/artifacts
59+
# .idea/compiler.xml
60+
# .idea/jarRepositories.xml
61+
# .idea/modules.xml
62+
# .idea/*.iml
63+
# .idea/modules
64+
# *.iml
65+
# *.ipr
66+
67+
# CMake
68+
cmake-build-*/
69+
70+
# Mongo Explorer plugin
71+
.idea/**/mongoSettings.xml
72+
73+
# File-based project format
74+
*.iws
75+
76+
# IntelliJ
77+
out/
78+
79+
# mpeltonen/sbt-idea plugin
80+
.idea_modules/
81+
82+
# JIRA plugin
83+
atlassian-ide-plugin.xml
84+
85+
# Cursive Clojure plugin
86+
.idea/replstate.xml
87+
88+
# SonarLint plugin
89+
.idea/sonarlint/
90+
91+
# Crashlytics plugin (for Android Studio and IntelliJ)
92+
com_crashlytics_export_strings.xml
93+
crashlytics.properties
94+
crashlytics-build.properties
95+
fabric.properties
96+
97+
# Editor-based Rest Client
98+
.idea/httpRequests
99+
100+
# Android studio 3.1+ serialized cache file
101+
.idea/caches/build_file_checksums.ser
102+
103+
main
104+

Diff for: Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:1.21-alpine
2+
LABEL authors="Tasnim Zotder <[email protected]>"
3+
4+
# Install make
5+
RUN apk add --no-cache make
6+
7+
WORKDIR /app
8+
9+
COPY go.mod ./
10+
# copy go.sum separately so that it doesn't invalidate the cache
11+
#COPY go.sum ./
12+
13+
RUN go mod download
14+
15+
COPY . .

Diff for: Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PROJECT_NAME = "terminal-dance"
2+
DOCKER_IMAGE_NAME = "tasnimzotder/$(PROJECT_NAME)"
3+
4+
docker-build:
5+
docker build -t $(DOCKER_IMAGE_NAME) .
6+
7+
docker-run:
8+
docker run -it --rm -v $(PWD)/frames:/app/frames $(DOCKER_IMAGE_NAME) sh -c "make local-run"
9+
10+
local-run:
11+
go build -o main . && chmod +x main && ./main
12+
13+
.PHONY: docker-build docker-run local-run

Diff for: README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Terminal Dance
22

3+
![demo](assets/demo.gif)
4+
5+
## Usage
6+
7+
1. Using docker
8+
9+
```bash
10+
make docker-build && make docker-run
11+
```
12+
13+
2. Using local environment
14+
15+
```bash
16+
make local-run
17+
```
318

419
## Credits
520

6-
- [GIPHY - Be Animated](https://giphy.com/)
21+
- [GIPHY - Be Animated](https://giphy.com/)

Diff for: assets/demo.gif

1.41 MB
Loading

Diff for: main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
const (
1414
CHARS = " .:-=+*#%@"
15-
REQ_SIZE = 250
15+
REQ_SIZE = 64
1616
)
1717

1818
// reduce the size of the gif to 100x100
@@ -113,5 +113,7 @@ func main() {
113113
time.Sleep(30 * time.Millisecond)
114114
clearConsole()
115115
}
116+
117+
time.Sleep(100 * time.Millisecond)
116118
}
117119
}

0 commit comments

Comments
 (0)