Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Development dockerfile #650

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gwynm
Copy link

@gwynm gwynm commented Feb 20, 2022

Modelled on the Production dockerfile, but simplifies the build process.
We mount the source code from the host machine and build it, then run
the servers in development mode, using Air to get live-reloading in Go.

Test photos are from thiscatdoesnotexist.com.

Modelled on the Production dockerfile, but simplifies the build process.
We mount the source code from the host machine and build it, then run
the servers in development mode, using Air to get live-reloading in Go.

Test photos are from thiscatdoesnotexist.com.
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.46%. Comparing base (e9a4839) to head (e4ca094).
Report is 100 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #650   +/-   ##
=======================================
  Coverage   42.46%   42.46%           
=======================================
  Files         146      146           
  Lines        4764     4764           
  Branches      633      633           
=======================================
  Hits         2023     2023           
  Misses       2549     2549           
  Partials      192      192           
Flag Coverage Δ
api 37.41% <ø> (ø)
ui 46.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@viktorstrate
Copy link
Member

Sorry for the late reply

I get the following error when running the docker-compose file, after air tries to build the go binary:

photoview_1  | building...
photoview_1  | # runtime/cgo
photoview_1  | cgo: C compiler "aarch64-linux-gnu-gcc" not found: exec: "aarch64-linux-gnu-gcc": executable file not found in $PATH
photoview_1  | failed to build, error: exit status 2

I'm using an intel macbook. I've tried both with and without TARGETPLATFORM='linux/arm64'.

Could have something to do with this line in the Dockerfile?

ENV COMPILER_ARCH aarch64-linux-gnu

The UI loads as expected though.

@gwynm
Copy link
Author

gwynm commented Mar 7, 2022

Sorry for the late reply

I get the following error when running the docker-compose file, after air tries to build the go binary:

photoview_1  | building...
photoview_1  | # runtime/cgo
photoview_1  | cgo: C compiler "aarch64-linux-gnu-gcc" not found: exec: "aarch64-linux-gnu-gcc": executable file not found in $PATH
photoview_1  | failed to build, error: exit status 2

I'm using an intel macbook. I've tried both with and without TARGETPLATFORM='linux/arm64'.

Could have something to do with this line in the Dockerfile?

ENV COMPILER_ARCH aarch64-linux-gnu

The UI loads as expected though.

Aha, yeah, I haven't tried this on intel. I didn't fully understand the cross-compiling setup, so I've probably broken something in this. I'll fish out an intel machine and have a look when I get a chance.

@viktorstrate viktorstrate self-requested a review March 28, 2022 16:53
@phcreery
Copy link

Should all the env variables be added to the dockerfile (both development and example production) for quick reference, even if they are just commented out?
https://github.com/photoview/photoview/blob/master/api/utils/environment_variables.go

@kkovaletp kkovaletp added help wanted Extra attention is needed feature A new idea or feature docker Related to deployment with Docker labels Apr 29, 2024
@kkovaletp kkovaletp linked an issue Apr 29, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Related to deployment with Docker feature A new idea or feature help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a docker container for development, or at least update doc
4 participants